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 %
Just run the command below in project root. You might installed it globally.
npm install react-scripts --save
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/
Try to remove node_modules folder and package-lock.json
sudo rm -rf node_modules
sudo rm package-lock.json
npm install
Related
I've laravel application deployed to Linux/Debian server, one of the steps that I have to do is to run npm run build for production
I got the following error:
npm run build
> build
> vite build
/tmp/build-ade1100b.sh: 1: vite: Permission denied
I tried to do this with sudo privilege, another user has sudo privilege too, it didn't work, I know this is a sticky folder, I tries too many solutions but no one work with me.
Any help please?
Delete your node_modules folder using rm -rf node_modules/
Reinstall the modules using npm i or yarn install
npm run build should now work again.
Ran npm i -g {library} inside my project and npm gave me an error because I didnt use sudo. instead of using sudo on a second attempt, I followed npm's suggestion to run sudo chown -R 501:20 "/Users/vorousjames/.npm" (inside my project).
now anytime I run an npm command (anywhere), I get bash: /Users/vorousjames/.npm-global/bin/npm: No such file or directory
How do I fix this so I can use npm again?
try running this in the terminal
export PATH="/Users/vorousjames/.npm:$PATH
if it works add that to your .bash_profile
I followed the command 'npm install -g electron', the command line gives me back an error 'EACCES:permission denied, mkdir /usr/local/lib/node_modules/electron/.electron'
I tried to give permission by 'chown -R root /usr/local/lib/node_modules/*', but still doen't work?
anyone seen the problem before?
solved:
at last I found you can install it directly without root or sudo
If you are using the -g flag for global, you have to either run the command as the root user or invoke the command with sudo
sudo npm install -g electron
when I try to install ionic via npm I get the following issue. The installation just stops when trying to install the node-sass package. This is what I get from the command line:
npm info install node-sass#3.4.1
> node-sass#3.4.1 install /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
> node scripts/install.js
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
The installation process just stops at this point. During installation, I've used the loglevel option to track the logs. Any ideas about what can be the cause of this error? Thanks Sandro
Hope this will help you.
if the last line of your cmd shows :
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
then its permission issue.
sudo chown -R *username*/usr/local/lib/node_modules/cordova/
if there is any issues with node-saas
It's trying to force node-sass#3.4.1
You Can Try using npm install node-sass to get the latest version(3.4.2).
OR
When i got problems with node-saas , friend on github helped me with using libsass commands:
$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^3.4.1"/g' package.json && npm install && ionic lib update
Where X is the version of gulp-sass in your package.json
Remove the old files in node_modules. I'm not sure is necessary to use 'sudo'
$ sudo rm -rf node_modules/
Search and replace inside package.json updating gulp-sass version to ^3.4.1. It also creates a backup (package.json.bak),
$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^3.4.1"/g' package.json
Reinstall dependencies
$ npm install
Update the ionic lib in the project
ionic lib update
I am trying to install nodemon but everytime I got stuck at the same part.
It get a response, but didn't end the job.
I have to stop it after some minutes with the state bellow.
I already try another modules and all of them install correctaly.
Could someone say what could be wrong or any other similar module?
Thanks.
Your environment has been set up for using Node.js 0.10.28 (x64) and npm.
C:\Users\>npm instal -g nodemon
npm http GET https://registry.npmjs.org/nodemon
npm http 304 https://registry.npmjs.org/nodemon
This has happened to me with other modules after canceling the install mid-way once, then when I do it again, it will get stuck.
I had to clear the cache before trying again.
npm cache clean
npm install -g nodemon
I've made it but I installed from the source and I did a git clone from the master branch, so try this out:
Create a folder:
mkdir nodemon
cd nodemon
clone the repo:
git clone https://github.com/remy/nodemon.git
then do an install in the folder you have created
npm install
Type nodemon just to make sure you have installed it.
in the case you got an erorr like this
Error: EACCES, permission denied '/home/[username]/.config/configstore/update-notifier-nodemon.yml'
You don't have access to this file.
try this
sudo chown [username]:[username] /home/[username]/.config/configstore/ -R