npm install Error: not found: python2 solution

When executing the npm i command in the ionic project, an Error: not found: python2 error occurs, and the error is as shown in the figure below
insert image description here

solution

1. Download python https://www.python.org/download/releases/2.7/
insert image description here

2. Install python
insert image description here

3. Set python environment variables

1) Right-click on the computer - Properties - Advanced System Settings - Advanced - Environment Variables

2) System variables—Add environment variable C:\Python27 (python installation directory) to Path

insert image description here
insert image description here


4. Then execute npm rebuild node-sass to refactor.


5. Then execute npm i.

Guess you like

Origin blog.csdn.net/qq_41231694/article/details/125928234