nodejs 异常 stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

青苗 青苗 | 353 | 2022-12-15

异常: stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

解决方法:

  • 清空 npm 缓存
npm cache clean --force
  • 管理员身份执行命令
npm install --global --production windows-build-tools

安装成功提示!

---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7

注意 C:\Users\用户名\.windows-build-tools\python27 添加到系统环境变量

执行命令:

npm config set python "D:\Python27\python.exe"
  • 安装 node-gyp
npm install --global node-gyp

然后 npm install 重新安装项目

文章标签: JavaScript
推荐指数:

真诚点赞 诚不我欺~

nodejs 异常 stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

点赞 收藏 评论

关于作者

青苗
青苗

青苗幼儿园园长

等级 LV5

粉丝 20

获赞 47

经验 1182