npm install 报 npm ERR! cb()never called!的错误
2023-09-11 14:16:34 时间
在开发项目安装依赖时(npm install) 往往会报 npm ERR! cb()never called!的错误
如图:
解决方法:
一、首先要以管理员模式打开cmd清除你的npm缓存 : npm cache clean -f
二、清除完缓存后,安装最新版本的Node helper: npm install -g n
注意:如果出现npm ERR! notsup Unsupported platform for n@2.1.8: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
这样错误信息
如图:
然后执行以下 npm install -g n --force
如图:
三、告诉助手(n)安装最新的稳定版Node:n stable
四、完成上一个命令后,您将获得最新信息。让我们再次运行安装: npm install
如果在执行npm install 非常缓慢的时候,可以试着更换镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
如图:
再执行 cnpm install,这时候就比较快一些安装依赖文件
安装完依赖文件后,执行 cnpm run dev ,项目就启动了。
以上是开发遇到的一个小问题,如有不足可以随时提出。谢谢
相关文章
- C#新手常犯的错误
- [Remoting FAQ]传递Remoting参数时遇到的两种常见错误
- 加载内核模块-Unknown symbol错误分析
- [NPM] npm check to update the dependencies
- [NPM] Create a new project using the npm init <initializer> command
- [NPM] Use package.json variables in npm scripts
- [NPM] Run a set of similar npm scripts with a wildcard
- [NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all
- [NPM] Run npm scripts in series
- 解决Office 2013无法打开文件并提示错误的问题
- [NPM] npm check to update the dependencies
- [NPM] Pull out npm scripts into another file with p-s
- [NPM] List available npm scripts and support tab completion
- linux(centos8):zabbix配置邮件报警(监控错误日志)(zabbix5.0)
- WCF 自定义工具错误: 无法生成服务引用“{0}”的代码
- Android错误:Re-installation failed due to different application signatures
- 160. 如何根据 SAP Fiori UI 界面上的错误消息,找到后台 ABAP 对应的消息 ID
- SAP OData实现错误消息:OPPORTUNITIES_GET_ENTITY not implemented in data provider class
- 错误消息“Conversion factors are invalid”的准确抛出位置
- 无法打开物理文件 "D:understructuredata _DAT.MDF"。操作系统错误 5:"5(拒绝访问。)"
- 错误1Files 的值“<<<<<<< .mine”无效。路径中具有非法字符。
- Bug总结:python语言中出现的import error错误的解决思路
- npm run dev 启动错误:Module build failed: Error: No PostCSS Config found in:xxxxxxxxxxxxxx
- 【错误记录】自定义 Gradle 插件报错 ( Could not find implementation class x for plugin x specified in jar:file )
- Windows 10更改计算机名验证名称报错出现“一般性网络错误”对话框
- LightGBM为什么比xgbost好?——选择梯度大(残差大)样本来进行特征分裂生成的树,借鉴了Adaboost的更改样本权重,错误的分类会更高权重对待
- e1084. 捕获错误和异常
- 错误一定会发生