npm安装报错找不到python、c++等:npm ERR

npm安装报错找不到python、c++等:npm ERR,第1张

问题描述

运行npm i 安装依赖包时,npm报错:
npm ERR! gyp info using node-gyp08.4.1
npm ERR! gyp info using [email protected] I win32 |×64
npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3"can be used

原因分析:

python没安装导致的,可能还有一些其他的node必须依赖没有安装

解决方案:

重装node.js,在安装程序中的最后一步勾选如下复选框:

之后node.js会安装自动安装必要的工具,d出一个命令行窗口,随意按几下空格,等待安装完成,若在安装过程中长时间没反应,可时不时的按下空格键

等待安装完毕后,重启所有cmd窗口,可以愉快的npm i 了

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/729815.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存