1、妹有用镜像——清空缓存 设置镜像 或者更换镜像源
2、npm node版本不和谐—— 以往的版本 | Node.js
3、npm node vscode版本过旧——更新
4、没使用管理员权限打开命令行——打开
5、网速——自己想办法
6、本地仓库——重新clone
7、gyp error yyds:
npm install -g node-gyp
npm install --global --production windows-build-tools
8、缺少node-sass
npm install node-sass@latest
(引自前端错误之gyp ERR! configure error - 程序员大本营
gyp ERR! stack Error: Can't find Python executa... - 简书
)
9、清空npm缓存
npm cache clean --force
拓展理解:
gyp是为Chromium项目创建的项目生成工具(用来编译原生C++模块),可以从平台无关的配置生成平台相关的Visual Studio、Xcode、Makefile的项目文件。这样一来我们就不需要花额外的时间处理每个平台不同的项目配置以及项目之间的依赖关系。
至于为什么要有node-gyp,是由于node程序中需要调用一些其他语言编写的工具甚至是dll,需要先编译一下,否则就会有跨平台的问题,例如在windows上运行的软件copy到mac上就不能用了,但是如果源码支持,编译一下,在mac上还是可以用的。
依赖安装成功,但是运行报错
(引自 解决Error: ENOENT: no such file or directory, scandir ‘xxx\node-sass\vendor‘_dummyTop的博客-CSDN博客)
node node_modules/node-sass/scripts/install.js
(传送门:
node-gyp - npm
win10 出现gyp ERR! build error_咖喱姬姬的博客-CSDN博客https://www.cnblogs.com/wangyuxue/p/11218113.html
解决 node-gyp 错误问题_技术人生-CSDN博客_nodegyp报错
)
npm error cb:never() called!:
(引自修复npm ERR! cb()never called!的错误 - 简书)