Here's my remote repo, I made the project with 'create-react-app': https://github.com/mattfrancis888/project_2
Whenever I clone the project and try to launch it with npm start. It gives me:
'react-scripts' is not recognized as an internal or external command, operable program or batch file.'
Why is that? I tried:
doing 'npm i'
npm install react-scripts --save ('react-scripts' is not recognized as an internal or external command)
deleting and cloning the project again.
The project works in my other computer (the desktop where I made the remote repo)
Use npx to solve the error "create-react-app is not recognized as an internal or external command, operable program or batch file", e.g. npx create-react-app my-app or install the package globally by running npm install -g create-react-app . The fastest way to solve the error is to use the npx command.
Run the npm install react-scripts command to solve the "react-scripts: command not found" error. If necessary delete your node_modules directory and your package-lock. json file, reinstall your dependencies and restart your development server. Copied!
You need to make sure that the package. json file is present from where you run the npm start command. When you don't see the package. json file, then run the pwd command to see if you are in the right directory.
The error “npm is not recognized as an internal or external command” error may occur because either the npm is not installed or it is not added to the windows path. To resolve this error, the first solution is to install Node. js on Windows as Node. js is equipped with npm by default.
This should solve the issue;
$ sudo rm -fr node_modules/ package-lock.json
$ sudo npm cache clean --force
$ sudo npm i react-scripts --unsafe-perm
$ sudo npm i --unsafe-perm
If still throws error,
Npm package versions and your environment are conflicting. Only way to fix is installing different versions and trying to find compatible environment to run your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With