首页 新闻 会员 周边

在有npm的基础上又下载了更高版本的npm怎么办

0
[已解决问题] 解决于 2022-06-23 15:43

在npm版本为6.4.1的情况下,下载了npm版本为7.0.8的,然后报错,在命令提示符中输入npm -v。
报错如下:
TypeError: Cannot destructure property stat of 'undefined' or 'null'.
at Object.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\node-gyp\lib\index.js:2:29)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\run-script\lib\run-script-pkg.js:4:55)
at Module._compile (module.js:653:30)
C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\config\lib\index.js:163
throw new Error('call config.load() before reading values')
^

Error: call config.load() before reading values
at Config.get (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\config\lib\index.js:163:13)
at process.errorHandler (C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:177:32)
at emitOne (events.js:116:13)
at process.emit (events.js:211:7)
at process._fatalException (bootstrap_node.js:391:26)

宋人鱼的主页 宋人鱼 | 初学一级 | 园豆:14
提问于:2022-06-15 17:30
< >
分享
最佳答案
0

卸载重装。

奖励园豆:5
顾星河 | 大侠五级 |园豆:7173 | 2022-06-16 11:04

好的,谢谢,问题解决了

宋人鱼 | 园豆:14 (初学一级) | 2022-06-17 11:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册