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

相关推荐
金融小师妹15 小时前
基于多源政策信号解析与量化因子的“12月降息预期降温”重构及黄金敏感性分析
人工智能·深度学习·1024程序员节
GIS数据转换器20 小时前
基于GIS的智慧旅游调度指挥平台
运维·人工智能·物联网·无人机·旅游·1024程序员节
南方的狮子先生1 天前
【C++】C++文件读写
java·开发语言·数据结构·c++·算法·1024程序员节
Neil今天也要学习2 天前
永磁同步电机无速度算法--基于三阶LESO的反电动势观测器
算法·1024程序员节
开开心心_Every2 天前
专业视频修复软件,简单操作效果好
学习·elasticsearch·pdf·excel·音视频·memcache·1024程序员节
liu****3 天前
16.udp_socket(三)
linux·开发语言·数据结构·c++·1024程序员节
草莓熊Lotso3 天前
《算法闯关指南:优选算法--位运算》--38.消失的两个数字
服务器·c++·算法·1024程序员节
unable code4 天前
攻防世界-Misc-can_has_stdio?
网络安全·ctf·misc·1024程序员节
思茂信息4 天前
CST License(Flexnet)设置与问题处理方法
服务器·网络·单片机·3d·php·1024程序员节·cst
2301_797892834 天前
论文阅读:《Hypergraph Motif Representation Learning》
论文阅读·1024程序员节