create-react-app-offline
create-react-app-offline copied to clipboard
npm start throws permission error
Running npm start after creating a project throws permission error.
Here is the output of npm:
$ npm start
> [email protected] start /tmp/demo
> react-scripts start
sh: /tmp/demo/node_modules/.bin/react-scripts: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] start: `react-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.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/siddharthroy/.npm/_logs/2020-10-04T07_44_15_291Z-debug.log
I have to run chmod +x node_modules/.bin/react-scripts
for it to works
i don't know which Linux distro are you using, but this solution should work anyway.
I think your npm don't have permission. you can try to run by sudo
sudo npm run build
or give permission 777 to this path and try to run project
sudo chmod -R 777 /usr/local/bin/npm
I'm using Manjaro. npm is installed with nvm
I am using Kali Linux 2019. The above solutions are not working.
This command slowed the issues for me on CentOS7
chmod +x node_modules/.bin/react-scripts
The problem is it works just fine for windows but failed for Linux.
I am on ElementaryOS and using yarn. In my project directory, running the command by @Baronsindo solved the problem for me. I tried so many commands from Stackoverflow. But this is the only thing that worked for me.
The command has made everything slow
Need your help on how to undo command 😥😥😥😥
Using this command worked for me. I'm using macOS Big Sur.
sudo chmod +x node_modules/.bin/react-scripts
This issue is still relevant. I am running Ubuntu 22.04.2 LTS, and I had to manually run the chmod
command to resolve it.