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

相关推荐
✿ ༺ ོIT技术༻3 天前
Linux:TCP和守护进程
linux·运维·服务器·网络·tcp/ip·1024程序员节
辅助东皇燕双鹰7 天前
行测知识()
1024程序员节
深蓝易网10 天前
探寻制造型企业MES管理系统:功能、架构与应用全解析
大数据·运维·人工智能·架构·制造·1024程序员节
Lenyiin15 天前
2848、与车相交的点
c++·算法·leetcode·1024程序员节
earthzhang202120 天前
《深入浅出HTTPS》读书笔记(31):HTTPS和TLS/SSL
开发语言·网络·python·https·1024程序员节
不讲废话的小白22 天前
怎么样把pdf转成图片模式(不能复制文字)
pdf·1024程序员节
明明真系叻23 天前
2025.1.26机器学习笔记:C-RNN-GAN文献阅读
人工智能·笔记·深度学习·机器学习·生成对抗网络·1024程序员节
Joeysoda1 个月前
Java数据结构 (从0构建链表(LinkedList))
java·linux·开发语言·数据结构·windows·链表·1024程序员节
清风-云烟1 个月前
使用redis-cli命令实现redis crud操作
java·linux·数据库·redis·spring·缓存·1024程序员节
Joeysoda1 个月前
Java数据结构 (链表反转(LinkedList----Leetcode206))
java·linux·开发语言·数据结构·链表·1024程序员节