在运行react项目安装npm时报npm ERR! cb()never called!如图:

解决方法:
1.首先以管理员模式打开cmd,清除npm缓存:npm cache clean -f

2.根据提示执行安装全局npm :npm install -g npm

安装完后查看npm版本:npm -v

再次执行清理缓存npm cache clean -f
2.安装最新版本的Node helper:npm install -g n
如果出现npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})这样的错误,如图:

然后执行npm install -g n --force
3.然后再执行npm install,或者用淘宝镜像安装:
npm install -g cnpm --registry=https://registry.npm.taobao.org ,我这里是用淘宝镜像安装的

4.执行npm install
安装cnpm加快npm install安装速度(cnpm 是npm 在淘宝的镜像,内容完全一致,国内下载速度快,安装一个全局的cnpm命令后,之后所有npm操作,都可以用cnpm替代)

5.执行cnpm run dev启动项目
运行成功

相关文章:
-
2021-06-07
-
2022-12-23
-
2022-12-23
-
2022-01-06
-
2022-12-23
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-07-29
-
2022-12-23
-
2022-12-23
相关资源
-
下载
2021-06-27
-
下载
2022-12-29
-
下载
2023-03-10
-
下载
2021-06-24