npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

react scripts not found

have a problem running npm start from my newly created project, the thing is the problem doesn’t seem to occur outside of this folder (its a git repo, so it needs to be in here). If i create a new project in another folder and run npm start I have no issues at all.

So I recently started working in Ubuntu 18.04LTS, gone through all the setup of installing nodejs and npm.

Currently running versions:

node = 10.16.0

npm = 6.9.2

So I created my app by using npx create-react-app

run npm start and gets this error:

sh: 1: react-scripts: not found
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! frontend@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the frontend@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

I tried deleting node_modules and package-lock.json, but no succes.

npm run env gives me this

npm.log (7.6 KB)

adding the fill path to react-scripts start, seems to work at first glance, but nothing actually gets rendered

Do you need to run npm install? This will install the dependencies, including react-scripts.

(I expect dependencies are installed as part of create-react-app but I am guessing you may have deleted the node_modules when preparing your project for adding files to git.)

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Hello, yes the node_modules are included in npx create-react-app, I have tried deleting both node_modules and package-lock.json with rm -rf and run npm install again, this still doesn’t solve anything

I have found the cause of this error.

Node has issues reading the path when a space is in the name of a folder, it simply breaks with the % symbol. We renamed the folder to container a - instead and the issue has been resolved.