帮助中心 >  产品文档 >  npm i 常见报错及解决方案

 蓝队云小课堂:

 

报错1

npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

解决方案:清理缓存后再次安装

npm cache clearforce

 

报错2

npm ERR! gyp info it worked if it ends with ok
...
npm
ERR! gyp ERR! cwd C:\\...\\node_modules\\node-sass
npm
ERR! gyp ERR! node -v v16.14.0
npm
ERR! gyp ERR! node-gyp -v v3.8.0
npm
ERR! gyp ERR! not ok
npm
ERR! Build failed with error code: 1

解决方案:安装最新版本的node-sass

npm install node-sass@latest

 

报错3

Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.

解决方案:先卸载node-sass再安装指定版本的

npm uninstall i node-sass
npm install node
-sass@4.0.0

 

报错案例4

npm ERR! cb() never called!
npm ERR! This is an error with npm itself.

解决方案:

1.删除项目中node_modules文件夹

2.删除项目中package-lock.json文件

以管理员权限执行下面的命令:

3.清除npm缓存 npm cache clean --force

4.npm i

 

更多小知识,可联系蓝队云一起探讨。


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: