0

I'm unable to use the command npm run start . The error the console returns is:

> @ start C:\Users\Aristophanes
> cd packages/react-scripts && node bin/react-scripts.js start

bash: line 0: cd: packages/react-scripts: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `cd packages/react-scripts && node bin/react-scripts.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

So if I'm correct the console is telling me there's no packages/react-scripts directory and no bin/react-scripts.js file.

I'm a bit confused. The only packages/react-scripts directory I can find on my computer is C:\Users\Aristophanes\create-react-app-next\packages\react-scripts.

And the bin/react-scripts.js file I have is located at C:\Users\Aristophanes\node_modules\react-scripts\bin\react-scripts.js

Does anyone have any ideas how I can fix this? As suggested by Mukyuu I tried running npm start in the directory C:\Users\Aristophanes\create-react-app-next\packages\react-scripts. This leads to the console error npm ERR! missing script: start. I have added "start": "node server.js" to the scripts section of my NPM package.json file and restarted cmd, but I still get the same missing script: start error in the console.

Aristophanes
  • 475
  • 1
  • 9
  • 21
  • are you able to use npm start? – Mukyuu Nov 08 '18 at 01:58
  • Hello, no I get the same error. – Aristophanes Nov 08 '18 at 02:01
  • actually .. `The only packages/react-scripts directory I can find on my computer is C:\Users\Aristophanes\create-react-app-next\packages\react-scripts` try to go to C:\Users\Aristophanes\create-react-app-next\packages\react-scripts first then go start – Mukyuu Nov 08 '18 at 02:06
  • Ok, I did that and now I get "npm ERR! missing script: start". So do I need to add a start script to my npm package.json? Currently there is one there called `"start:dev": "webpack-dev-server"`. – Aristophanes Nov 08 '18 at 02:18
  • You haven't defined the start script in your `package.json` for further detail you might want to check https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start – Mukyuu Nov 08 '18 at 02:27
  • So if I add `"start:"` to `package.json` what do I assign to it after the colon? – Aristophanes Nov 08 '18 at 02:40
  • by default it was `"start": "node server.js"` or you could define your own application script `"start": "node your-script.js"` – Mukyuu Nov 08 '18 at 02:44
  • Possible duplicate of [Start script missing error when running npm start](https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start) – Mukyuu Nov 08 '18 at 02:46
  • Hmm, I added `"start": "node server.js"` to my `package.json` file and restarted cmd, but I still get the same `missing script: start` error in the console. – Aristophanes Nov 08 '18 at 02:50

0 Answers0