npm install时 Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.解决办法

34 篇文章 7 订阅

错误原因:Node.js 在安装模块的时候报错,缺少python环境。

 找不到Python可执行文件“Python”,可以设置Python env变量。

解决办法:

第一种方式:

安装Python及环境变量配置

一定要安装python2.7的版本

环境变量安装可以参考:Win 10安装Python及环境变量配置_LYJ_viviani的博客-CSDN博客_python安装教程win10

如果第一种方式不行可以试试第二种方式。

第二种方式:

运行下面的命令

npm install --global --production windows-build-tools

如果输入上述代码报Please restart this script from an administrative PowerShell!错误,则需要在管理员权限下运行

第三种方式:

命令行添加方式,添加python环境到Node中

  • 输入如下命令,在命令窗口中。
npm config set python C:\Python27\python.exe

2022:checking for Python executable "python2" in the PATH - 北极的大企鹅 - 博客园## 一、node报错 gyp verb check python checking for Python executable "python2" in the PATH gyphttps://www.cnblogs.com/liuyangfirst/p/16017548.html

参考自Can‘t find Python executable “ python“, you can set the PYTHON env variable_哼,小呀么小胖子的博客-CSDN博客

参考自Error: Can't find Python executable "python", you can set the PYTHON env variable.解决办法_yhy_的博客-CSDN博客

参考自:2022:checking for Python executable "python2" in the PATH - 北极的大企鹅 - 博客园 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值