When I type
npm start
this msg I get
npm start
[email protected] start
react-scripts startnode:internal/modules/cjs/loader:1145
throw err;
^Error: Cannot find module ‘E:ownwebsitemironode_modulesreact-scriptsbinreact-scripts.js’
at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
at Module._load (node:internal/modules/cjs/loader:983:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
at node:internal/main/run_main_module:28:49 {
code: ‘MODULE_NOT_FOUND’,
requireStack: [] }Node.js v21.7.1
I tried install the react file but it just not worked out by the npm i -S react-scripts, nor the yarn add react.
I have no clue what to do.
Thanks for any help in advance too
2
Answers
Try running npm i to install all packages.
If problem still persists, check to see if there is an & in your project pathname. This is a strange problem which has already been solved here: Error: Cannot find module 'react-scriptsbinreact-scripts.js'
step1: try to delete node_modules folder and package-lock.json
step2: we need to clear the cache, if any packages has been corrupted.
use this command
npm cache clean --force
step3: try installing all the dependencies using
npm install
step4: after installation of the packages, open package.json file and verify the json file
note: if still issue exists, cross check the npm version is latest