npm install启动报错,Can‘t find Python executable “python“, you can set the PYTHON env variable

Can't find Python executable "python", you can set the PYTHON env variable

describe

After executing the npm install command, an error is reported. The error message is that the installation of node-sass failed, and at the same time, it prompts an error message that the python environment is required. This is because the installation of node-sass failed, and node-sass depends on the Python environment. node-sass The installation fails because the default is to download from a foreign line. Everyone knows that the failure rate is high when the network speed is not good. .

Error screenshot

insert image description here

Solution

1. Set up domestic mirroring

npm install -g cnpm --registry=https://registry.npm.taobao.org

2. Download toolkit

cnpm install --global --production windows-build-tools

3. Then you can npm install

2. If the above is unsuccessful, the second solution is to download Python simply and rudely. Be sure to download the 2.7.X version. I downloaded the 2.7.18 version and solved it successfully.
Please add a picture descriptionThe above code can also be used if the following error occurs.

Guess you like

Origin blog.csdn.net/qq_51753851/article/details/125796097