I have installed the nodejs. However, when i run a command to install reactjs , it throws an error.
command prompt:
npx create-react-app my-app
Error:
node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module 'D:nodenode_modulesnpmbinnpm-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.17.0
node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module 'D:nodenode_modulesnpmbinnpx-cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.17.0
It is important to note that i have installed the node 3 years ago. it was working fine. However, when i recently deleted and then re-intalled it, it is shows these kind of errors. Perhaps, there is some pre-installed file colliding with the flow of the program.
2
Answers
cra
officially deprecatedyou can use
yarn create vite
, or some framework likenext
,astro
,remix
, otherwise if you needpure
react, similar tovite
you can look onparcel
, orwebpack
https://dev.to/ag2byte/create-react-app-is-officially-dead-h7o
The error "Cannot find module npm-cli.js" occurs when the path to Node.js in your system’s PATH environment variable is incorrect.
To solve the error, repair the Node.js application and correct the path.
Use this guide to solve the error:
https://bobbyhadz.com/blog/npm-error-cannot-find-module-npm-cli-js