0

Running npm start after npm init does not work due to reported missing react-script library.

It is on my Windows 10 machine; I tried uninstalling and reinstalling node but it did not help.

I can only run my project by typing

>node .\node_modules\react-scripts\bin\react-scripts.js start 

otherwise if I run:

>npm start

I can see errors pasted below.

reactapptest@0.1.0 start C:(...)\reactapptest react-scripts start npm ERR! file bash npm ERR! path bash npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn bash npm ERR! reactapptest@0.1.0 start: react-scripts start npm ERR! spawn bash ENOENT npm ERR! npm ERR! Failed at the reactapptest@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It looks like something is wrong with my path but I am not sure and I do not know how to solve it.

marcinwal
  • 169
  • 10

1 Answers1

1

The specific error you are getting points out that bash is not available. Now bash is a shell for Unix and Unix-like environments, it is not typically installed on Windows by default. (Though it is available for Windows as well through MinGW.)

You are working on Windows, you should not need bash with react-scripts. Try upgrading npm with npm install -g npm@latest to see if this is caused by an old and broken version of npm on your system.

EDIT: Also, you may have previously configured npm to use bash. See: how to set shell for npm run-scripts in windows and note that you are pretty much trying to do the opposite, so if you have custom configuration you might want to try removing it (also explained in the linked accepted answer).

user268396
  • 11,576
  • 2
  • 31
  • 26