I’m getting this error when I try to deploy my React app on render.com. I have installed react-scripts in it also and I also tried by deleting node_modules/ folder.
check whether react-scripts is there or not. if not then install it.
if it still doesn’t works, delete your node_modules and install all packages again.
3
Answers
First check if
"react-scripts"
exists on your dependencies in your package.jsonthan On render.com make sure you selected static site because you can only deploy React via a Static Site
you can check the docs it’s mentioned there
check whether react-scripts is there or not. if not then install it.
if it still doesn’t works, delete your node_modules and install all packages again.
It looks like you may be missing a command in your build step.
If you used the Render Create React App doc, note that Render just updated the doc to fix the build command.
The build command should be
yarn; yarn build
(instead of justyarn
).Thanks to @metonym for the fix.