前端报错npm ERR! cb() never called!问题解决办法
环境使用node版本v14.21.3,npm版本6.14.18
1.问题描述
1.1使用npm install后报错
npm ERR! cb() never called! npm ERR! This is an error with npm itself. Please report this error at: npm ERR! <https://npm.community> npm ERR! A complete log of this run can be found in:
2.解决问题过程
2.1看网上大部分的解决方式是:
删除 node_modules 目录,删除 package-lock.json 文件,清除缓存,再重新npm install,不过一般出现这个问题并不会生成 package-lock.json 文件
2.2网上还有部分的解决方式是:
使用npm uninstall -g npm更新npm版本来解决这个问题,不过我们一般会安装node和npm的匹配版本。
如果node和npm版本不匹配就会报这个问题
ERROR: npm v10.5.0 is known not to run on Node.js v14.21.3. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
ERROR:
D:\Program Files\nodejs\node_cache\node_modules\npm\node_modules\@npmcli\agent\lib\agents.js:105
options.lookup ??= this.#options.lookup
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1029:16)
at Module._compile (internal/modules/cjs/loader.js:1078:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (D:\Program Files\nodejs\node_cache\node_modules\npm\node_modules\@npmcli\agent\lib\index.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)2.2.1如果你不幸的按照网上使用npm uninstall -g npm升级了版本
那么可以去删除nodejs\node_cache\node_modules\npm的文件,原来的npm文件会在nodejs\node_modules目录下。不需要重装node和npm来解决
3.解决步骤
好了,现在回到我们一开始需要解决的这个问题上。
导致这个问题是文件夹的权限没放开导致的,知道的就可以不往下面看了。
不知道调整文件夹权限的按照下方的图片步骤解决即可。



弄完之后去之前报错的前端项目下使用npm install命令即可
总结
到此这篇关于前端报错npm ERR! cb() never called!问题解决办法的文章就介绍到这了,更多相关前端报错npm ERR! cb() never called内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
- npm ERR! code 128的错误问题解决方法
- npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错问题解决
- npm ERR! code E404在vscode安装插件时报错的两种解决方案
- npm ERR! Node.js v20.11.0错误的解决
- 用npm install时报错node-sass npm ERR command failed问题的解决方法
- 启动myvue报错npm ERR! code ENOENT npm ERR! syscall open的解决办法
- 解决Node.js包管理器安装报错npm ERR! code 1的问题
- npm ERR! code ELIFECYCLE错误及解决方法
- node中npm ERR! network ‘proxy‘ 配置问题解决
相关文章
Vue-router 报错NavigationDuplicated的解决方法
这篇文章主要介绍了Vue-router 报错NavigationDuplicated的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-03-03
npm如何更新VUE package.json文件中依赖的包版本
这篇文章主要介绍了npm如何更新VUE package.json文件中依赖的包版本问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教2023-06-06
实现shallowReadonly和isProxy功能示例详解
这篇文章主要为大家介绍了实现shallowReadonly和isProxy功能示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪2022-12-12
vite配置别名并处理报错:找不到模块“xxx”或其相应的类型声明方法详解
我在学习vue3+vite+ts的时候,在配置别名这一步的时候遇到了一个问题,这篇文章主要给大家介绍了关于vite配置别名并处理报错:找不到模块“xxx”或其相应的类型声明的相关资料,需要的朋友可以参考下2022-11-11


最新评论