前端报错npm ERR! cb() never called!问题
创始人
2024-12-27 13:08:50
0

环境使用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!       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. (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命令即可

相关内容

热门资讯

曝光秘籍!海商娱乐辅助器,we... 曝光秘籍!海商娱乐辅助器,wepoker辅助脚本,详细教程(有挂存在)1、进入游戏-大厅左侧-新手福...
七分钟辅助!wepoker怎么... 七分钟辅助!wepoker怎么设置房间,aapoker能控制牌吗,详细教程(有挂解惑)在进入wepo...
一分钟揭秘!hhpoker辅助... 一分钟揭秘!hhpoker辅助器,亲友联盟能开挂不,总结教程(证实有挂)1、打开软件启动之后找到中间...
了解手册!广东雀神智能插件是真... 了解手册!广东雀神智能插件是真有挂,山西扣点免费辅助下载,详细教程(确实有挂)1、下载好广东雀神智能...
第8分钟辅助!aapoker发... 第8分钟辅助!aapoker发牌逻辑,哈糖大菠萝有挂吗,详细教程(有挂神器)1、超多福利:超高返利,...
发现一款!德州真人透视脚本,上... 发现一款!德州真人透视脚本,上饶中至辅助软件怎么用,机巧教程(真实有挂)1、起透看视 上饶中至辅助软...
普及法门!广东雀神麻雀辅助神器... 普及法门!广东雀神麻雀辅助神器,越乡游义乌辅助器免费试用,详细教程(证实有挂)1、起透看视 广东雀神...
第八分钟辅助!wepokerp... 第八分钟辅助!wepokerplus透视脚本免费,WePOker有没有透视方法,详细教程(了解有挂)...
此事备受玩家关注!hhpoke... 此事备受玩家关注!hhpoker为什么一直输,闲闲辅助器,练习教程(证实有挂)1.闲闲辅助器 选牌创...
推荐讲义!新超凡软甲辅助,微信... 推荐讲义!新超凡软甲辅助,微信开心泉州辅助,详细教程(有挂秘诀)新超凡软甲辅助透视方法中分为三种模型...