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

技术知识 2020-06-18 15:50:57 阅读 17187 次
# 问题 > 我们在执行` npm install ` 或 `yarn`命令的时候有时会遇到错误 ```sh Error: Can't find Python executable "python", you can set the PYTHON env variable ``` 进而导致安装部分包错误,今天带大家简单快捷地100%解决这个问题 # 解决方法 - windows 平台下,管理员权限执行以下命令,安装完即可: ```sh npm install --global --production windows-build-tools ``` - 其他平台,访问 [https://github.com/nodejs/node-gyp](https://github.com/nodejs/node-gyp) ```sh npm install --global node-gyp ```
您可能感兴趣的
1、在命令前加上 sudo 2、sudo npm install --unsafe-perm=true 3、sudo npm install --unsafe-perm=true --allow-root
1、输入`which npm`可以得到 自己安装的npm位置 2、建立链接3、sudo ln [option]
国内使用 yarn 速度很慢,默认是去 npm/yarn 官方镜像源获取需要安装的具体软件信息,你可以重新修改镜像源。与npm命令比较
Top