2

I am using Node - v10.6.0 Npm version -4.6.1

When i tried to execute the commad npm start under my project folder, it is giving an error

[email protected] start /mnt/E/react_native/my_app

react-native-scripts start

sh: 1: react-native-scripts: Permission denied npm ERR! code ELIFECYCLE npm ERR! errno 126 npm ERR! [email protected] start:react-native-scripts start npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Please help to rectify the issue

7 Answers 7

1

I think you are running your code on MAC. If yes then please try running below command:

sudo chown -R username:groupname directory

where "username" is your current user name, "groupname" is your primary group and "directory" is your project directory path.
Afterwards remove node_modules folder and try below commands:

npm install
npm start
Sign up to request clarification or add additional context in comments.

Comments

1

I encountered the same issue, Surprisingly it works fine in Windows but failed in Linux giving the same error. Follow below step to resolve this issue.

you need to change package.json file inside your project folder like below instead of default value of "start": "react-scripts start"

"scripts": { "start": "node ./node_modules/react-scripts/bin/react-scripts.js start" }

Comments

1

Try running:

sudo sysctl -w fs.inotify.max_user_instances=1024  
sudo sysctl -w fs.inotify.max_user_watches=12288

before

npm start

This will temporarily increase the number of files that the development server is able to monitor for changes. This solution is specific for Ubuntu/Linux - the macOS equivalent is "kern.maxfiles" and "kern.maxfilesperproc"

Comments

0

If you haven't installed webpack-dev-server please do it by issuing the below command

npm install -g webpack webpack-dev-server

In case if you have already done it, try deleting your node_modules directory and run a fresh npm install before you execute your react-native-scripts start command.

Hope this helps.

Comments

0

You may not have necessary permissions, so you see:

sh: 1: react-native-scripts: Permission denied

Try starting it with :

sudo react-native-scripts start

Comments

0

I was having this issue. It was running after executing sudo chmod -R 755 .

Comments

0

I solved such a problem by making sure that my react-script binary was executable.

$ chmod +x node_modules/.bin/react-scripts

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.