npm install报错 缺少python

报错信息:

javascript 复制代码
Building:E:tols'nvm'nodesnodeexe : ode emos ant-desig-we-eos odemodules node-gyp'bintnode-gp.s rebld -verbose -Libsass_ext= --Libsas_cflags-
lags= --libsass_library=gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli'E: toolsnvm  nodes  node .exe!gyp verb cli'E:\\Codellemosllant-design-vue-emosllnode_moduleslnode-gypllbinllnode-gyp.js'
gyp verb cli'rebuild'gyp verb cli--verbose''--libsass_ext=',gyp verb cligyp verb clii--libsass_cflags='
gyp verb cli
'--libsass ldflags='
gyp verb cli
'--libsass library=
gyp verb cli ]
gyp info using node-gyp@3.8.0gyp info using node@14.17.0  win32  x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
which' failed Error: not found: python2gyp verb
at getNotFoundError (E:\Codeemoslant-design-vue-emosnode_modules\which\which.js:13:12)
gyp verbwhich*failed
gyp verbwhich*failed
at F (E:\Code emos ant-design-vue-emos\nodmodules which which.is:68:19
at E (E:\Code emos ant-design-vue-emos\node.modules\which\which.js:80:29
which*failedgyp verb
gyp verbwhich*failedgyp verbfailedwhich'
at E:\Code\emos\ant-design-vue-emos\nodemodules\which\which.js:89:16
at E:\Code emos ant-design-vue-emos node.modules isexe index.js:42:5
gyp verbwhich' failedat E:\Code\emos\ant-design-vue-emos\node_modules\isexe\windows.js:36:5at FSRegCallback.oncomplete (fs.js:192:21)gyp verb which' failedpython2 Error: not found: python2

解决方法:

用管理员方式打开cmd:

javascript 复制代码
//先执行这个
npm install -g node-gyp
//在执行这个
npm install --global --production windows-build-tools

把node_modules中的全部删掉重新yarn install或者 npm install

相关推荐
玛哈特-小易1 小时前
玛哈特矫平机:精密制造中的平整大师
制造·微信公众平台·1024程序员节·矫平机
惜.己1 天前
Jmeter中的断言(二)
测试工具·jmeter·1024程序员节
西电研梦2 天前
考研倒计时30天丨和西电一起向前!再向前!
人工智能·考研·1024程序员节·西电·西安电子科技大学
惜.己2 天前
Jmeter中的断言(四)
测试工具·jmeter·1024程序员节
·云扬·2 天前
Java IO 与 BIO、NIO、AIO 详解
java·开发语言·笔记·学习·nio·1024程序员节
网安_秋刀鱼2 天前
PHP代码审计 --MVC模型开发框架&rce示例
开发语言·web安全·网络安全·php·mvc·1024程序员节
HUODUNYUN2 天前
小程序免备案:快速部署与优化的全攻略
服务器·网络·web安全·小程序·1024程序员节
惜.己3 天前
Jmeter的后置处理器(二)
测试工具·github·1024程序员节
惜.己3 天前
Jmeter中的断言(一)
测试工具·jmeter·1024程序员节
cainiao0806053 天前
《物理学进展》
1024程序员节·核心期刊·知网期刊·职称评审