接触了npm、node、一段时间了,最近导入一个新项目,遇到了个棘手的问题,那我是怎么搞得呢?
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
先是一顿猛操作
1.清缓存
2.多次重新npm install
3.降级npm版本
.....
问题:
在编译vue的时候,npm install的时候报错 npm err code 1
解决:
使用‘ npm i -g npm ’ 命令,然后再 npm install,npm run dev 的时候就正常能启动项目了。
但是
然后依旧没有解决
-
降级
举例:降级到6
npm install npm@6 -g(@后跟版本号,若跟的是大版本,则更新到对应大版本最新的小版本)
npm install npm@6.14.14 -g(更新到指定版本) -
升级
npm install npm -g(更新到最新版本)