npm i报错 npm ERR! path git npm ERR! code ENOENT npm,后续npm i继续报错gyp ERR! node -v v12.13.1
·
1,新搭建的环境,node版本,npm版本,Vue-cli版本,webpack版本都应该是最新的,具体版本号如下:
2,之后npm i就报错如下:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
3,解决方法:
安装git,但是git官网的下载速度特别特别慢,这里为你提供一个下载速度快的安装包,和官网是一样的正版,亲测有效,附上网址链接: link,选择你需要的版本。安装完git之后,再npm i一下看看可行,虽然不知道git好人npm是什么关系,但是真的就不报那样的错了
4,但是新的错误又出现了,错误如下:
gyp ERR! stack Error: Can't find Python executable "python" you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Users\guxuelong\Desktop\dragon-ui\node_modules\.npminstall\node-gyp\3.3.1\node-gyp\lib\configure.js:401:14)
gyp ERR! stack at C:\Users\guxuelong\Desktop\dragon-ui\node_modules\.npminstall\node-gyp\3.3.1\node-gyp\lib\configure.js:356:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\javadev1\\Desktop\\dragon-ui\\node_modules\\.npminstall\\node-gyp\\3.3.1\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Javadev1\\Desktop\\dragon-ui\\node_modules\\.npminstall\\fsevents\\1.0.11\\fsevents\\lib\\binding\\Release\\node-v47-win32-x64\\fse.node" "--module_name=fse" "--module_path=C:\\Users\\javadev1\\Desktop\\dragon-ui\\node_modules\\.npminstall\\fsevents\\1.0.11\\fsevents\\lib\\binding\\Release\\node-v47-win32-x64"
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v12.13.1
gyp ERR! not o
5,说是什么缺少python,难就安装一个python吧,解决方法:
运行以下命令:
npm install --python=python2.7
npm config set python python2.7
再npm i一下,再运行npm run dev / npm run serve 即可解决
记一次找错记录!!!!!!!!!!!
更多推荐
已为社区贡献3条内容
所有评论(0)