嗯,我安装了一个过时的软件包,我...打破了npm.错误:
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module 'C:\Users\nguye\AppData\Local\nodejs\node_modules\npm\bin\npm-cli.js'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:804:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
当我试着去弥补的时候,事情发生了:(我使用的是Node.js 16.17.0 LTS)
>npm i npm-cli --save
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module 'C:\Users\nguye\AppData\Local\nodejs\node_modules\npm\bin\npm-cli.js'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:804:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
2条答案
按热度按时间pgvzfuti1#
Uninstall node and npm, and reinstall。这可能会在您的系统中正确设置路径。
z18hc3ub2#
1.删除node_modules目录
1.删除package-lock.json文件
1.运行npm安装
1.运行npm start或npm run dev