2

I'm trying to run a node and react js project that i got from someone else and this is the error that i get. Can someone please help me fix this?

cd frontend
npm start

> frontend@0.1.0 start
> react-scripts start

sh: /Users/..../...../...../frontend/node_modules/.bin/react-scripts: Permission denied
.... frontend % 

Delia
  • 23
  • 1
  • 2
  • 5
  • Does this answer your question? ["npm run build" = "react-scripts: Permission denied"](https://stackoverflow.com/questions/62140265/npm-run-build-react-scripts-permission-denied) – Mahdi Zarei Jan 20 '22 at 13:39
  • `packages.json` has to be checked, where script start points. – Alex Szücs Sep 01 '22 at 15:03

3 Answers3

4

You don't have required permissions in the given directory.
You can run

sudo npm start

or update permissions for the directory

sudo chmod 777 -R Your_Dir/
  • `npm ERR! Missing script: "start" npm ERR! npm ERR! Did you mean one of these? npm ERR! npm star # Mark your favorite packages npm ERR! npm stars # View packages marked as favorites npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run` – Delia Jan 20 '22 at 13:53
2

Just run the command below in project root. You might installed it globally.

npm install react-scripts --save
Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
-2

Try to remove node_modules folder and package-lock.json

sudo rm -rf node_modules
sudo rm package-lock.json
npm install
Venom
  • 97
  • 6