Home > Mobile >  npm install express is not workimg
npm install express is not workimg

Time:07-29

It shows:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '../lib/cli.js'
Require stack:
- 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 Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

CodePudding user response:

I think you can try this


rm -rf node_modules
npm install

CodePudding user response:

It turns out the issue is due to the wrong path of node in system variable

update as C:\Program Files\nodejs

  • Related