-2
    >npm -v
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.4.0
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
←[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)←[39m
←[90m    at node:internal/main/run_main_module:17:47←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: []
}

Node.js v17.4.0

我在我的电脑上安装了node,但是它显示这个错误,请告诉我如何在windows中解决这个问题?我在我的电脑上安装了node,但是它显示这个错误,请告诉我如何在windows中解决这个问题?我在我的电脑上安装了node,但是它显示这个错误,请告诉我如何在windows中解决这个问题?我在我的电脑上安装了node,但是它显示这个错误,请告诉我如何在windows中解决这个问题?

4

1 回答 1

-2

尝试卸载 NodeJS 并重新安装

尝试使用稳定版: https ://nodejs.org/dist/v16.13.2/node-v16.13.2-x64.msi

于 2022-01-25T16:32:57.440 回答