最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - Unable to start React App. Error "Cannot find module 'npm-cli.js'" - Stack Overflow

programmeradmin1浏览0评论

I am newbie to react technology and I faced an error while running a react app:

I have created demo react app without any additional addons and then I am trying to "npm start" - below error appears on TERMINAL.

PS C:\DATA\MyWork\react-app-poc> npm start
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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I have even tried npm run start but I am unable to start the app. For Node.js, I am using version 16.13.0 LTS.

What is the issue here?

I am newbie to react technology and I faced an error while running a react app:

I have created demo react app without any additional addons and then I am trying to "npm start" - below error appears on TERMINAL.

PS C:\DATA\MyWork\react-app-poc> npm start
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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
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:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I have even tried npm run start but I am unable to start the app. For Node.js, I am using version 16.13.0 LTS.

What is the issue here?

Share Improve this question asked Feb 4 at 7:26 Creative LearnerCreative Learner 233 bronze badges 1
  • Check this one out - stackoverflow/questions/71482020/… – Martin Wangen-Eriksen Commented Feb 5 at 10:18
Add a comment  | 

1 Answer 1

Reset to default 0

The error indicates that either you do not have 'npm' or 'node' installed, or there was an error installing them.

Check if they are installed by running the following commands in the terminal

'node -v'

'npm -v'

If they are not installed, make sure to install them.

发布评论

评论列表(0)

  1. 暂无评论