Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm start gives me : 'react-scripts' is not recognized as an internal or external command, operable program or batch file.'

Tags:

npm

reactjs

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)

like image 349
Matthew Francis Avatar asked Apr 26 '19 21:04

Matthew Francis


People also ask

How do you fix create-react-app is not recognized as an internal or external command operable program or batch file?

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.

How do I fix react-scripts not found?

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!

Why npm start is not working?

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.

Is not recognized as an internal or external command npm script?

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.


1 Answers

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,

  • Change version of your NPM

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.

like image 129
Cihangir Bozdogan Avatar answered Nov 15 '22 06:11

Cihangir Bozdogan