I recently started coding again and I've got some issues regarding React/NodeJS (don't know which one is responsible for that)
So first things first, I installed VSCode, all clean, no errors no nothing. Then I installed NodeJS. Now I'm just trying to create a React project for my own. I didn't install React at all as it seems it came by default after installing NodeJS. Now comes the ugly stuff. Whenever I use the "npx create-react-app something-name" I get the following:
$ npx create-react-app demo
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
I also get some audit errors/vulnerabilities but maybe they are not so important as they get fixed after I use "audit fix --force".
So let's say that we just want to start the project. I use cd something-name and npm start and I get this:
$ npm start
> [email protected] start
> react-scripts start
The system cannot find the path specified.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'D:\react-scripts\bin\react-scripts.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: []
}
If anybody could help me remove those warnings from NPM and also let me know what should I do in order to start my project would be highly appreciated!
CodePudding user response:
Hello there sir here are some possible fixes according to a previous question Error: Cannot find module '\react-scripts\bin\react-scripts.js'
Check your package.json file in your project folder
delete node_modules, and package.lock.json reinstall them by
npm install
Check if your project path has a special character which is "&" just remove it
Try running a production build
//makes the production build
npm build
// runs the production build
npm run build
- Finally try reinstalling node js on your system that could be the issue aswell
CodePudding user response:
check your node version and make sure is updated.
- remove the node-modules ()
- npm install
- npm start