"sh: 1: react-scripts: not found" In Docker "sh: 1: react-scripts: not found" In Docker reactjs reactjs

"sh: 1: react-scripts: not found" In Docker


I have a similar issue and I managed to work around by changing:

"start: "react-scripts start"

to:

"start: "./node_modules/.bin/react-scripts start"

in the scripts section package.json.

I use the classic node base image but it should work more or less the same.
And I am still investigating why NPM is not able to resolve react-scripts when running inside Docker, any further help is very welcome :-)


This happened to me when 'react-scripts' was listed under the 'devDependencies' in the package.json file. Moving it to the "dependencies" section solved the issue.


Deleting package-lock.json and re-installing packages with npm install before building the container solved the issue for me.