0
npm start

> demo@0.1.0 start
> react-scripts start

sh: 1: react-scripts: not found

After running npm start command my react project is not running and giving this error

i am using ubuntu 20.04

  • node version 16^
  • npm version 8^
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    before asking your questions, please check if a similar question was asked before. [here](https://stackoverflow.com/questions/40546231/sh-react-scripts-command-not-found-after-running-npm-start) you will probably find your answer. – Mohammad Salehi Apr 15 '22 at 17:41

1 Answers1

0

You have to run npm install first

Konrad
  • 21,590
  • 4
  • 28
  • 64
  • I changed "start": "react-scripts start" to "start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start" now it working for npm or yarn start but for build it is still giving this error what is the reason behind this ? – Muhammad Kashif Shafique Apr 16 '22 at 07:06
  • For it looks like fi you have package-lock.json missing or something like this – Konrad Apr 16 '22 at 07:10
  • i am thinking it may be because of not successfully having link to react-scripts so do i have to change every script like this ? – Muhammad Kashif Shafique Apr 16 '22 at 07:21
  • I never have to do something like this. In my opinion reverting this script back to just react-scripts and removing node-modules and running `npm install ` should fix everything. If not that means you have an issue with npm configuration – Konrad Apr 16 '22 at 07:26