Im trying to downgrade node version with this command: npm install -g n but I have this error: [Error: EACCES: permission denied, unlink '/usr/local/bin/n']
Then, I have to use this command to downgrade: n 6.10.3
How can I fix the permission denied error?
Use sudo npm install -g n to run the command as a super user.
Related
When I tried to install Chrome driver npm install chromedriver --chromedriver-force-download with node js, I am getting this error: chromedriver installation failed error eacces permission denied mkdir.
I have applied full permission of 777 and I'm still getting this error, can anyone please help me why I'm getting this error?
I used these commands:
1) npm i chromedriver
2) Force Download : npm install chromedriver --chromedriver-force-download
This one works for me on Ubuntu 20.04
sudo npm -g install chromedriver --unsafe-perm=true --allow-root
Try out using the sudo keyword
1)sudo npm i chromedriver
2) Force Download :sudo npm install chromedriver --chromedriver-force-download
I am having an issue running my node application on a different computer than the one I usually use. After a lot of troubleshooting:
The error message I'm getting is:
Error: ENOENT: no such file or directory, scandir '.../node_modules/node-sass/vendor'
A posting that I was reading suggested that I run sudo npm install -g node-sass, which gives me the following error:
Error: EACCES: permission denied, mkdir '...nvm/versions/node/v8.9.0/lib/node_modules/node-sass/build'
I then tried to run sudo npm rebuild node-sass but I'm getting the same error message:
Error: EACCES: permission denied, mkdir '.../node_modules/node-sass/build'
I then ran sudo npm install -g node-sass --unsafe-perm=true --allow-root but it also didn't work:
ENOENT: no such file or directory, scandir '.../node_modules/node-sass/vendor'
What am I doing wrong here? Why isn't node-sass working? Why isn't sudo working properly?
Windows. Try below
node node_modules/node-sass/scripts/install.js
npm rebuild node-sass
Most probably it's not node-sass issue. This sometimes happens when you use different OS to install node-sass. As it uses some native components, the npm install must only be done one OS. Do not copy node_modules from some other place. Do a fresh install.
Have you tried deleting the node_modules directory and running npm install again?
Are you working on Windows machione where the npm install was done using a Ubuntu shell (inside windows) and now you are trying to install again from the windows command line? If so, dont. Use only one shell.
Finally if none of these help, then its possible a user permission issue. Check if you can get super user access sudo su - and then try doing a fresh npm install.
Your user does not has the rights to write in the folder you are trying. You are using 3 ... so it goes to the folder /Users on the second one you have ...nvm/versions/node/v8.9.0/lib/node_modules
This is because of a missing node-sass dependency or broken node-sass package issue.
You can resolve this by the following steps:
Install node-sass globally, if it is not installed in your system.
npm install -g node-sass
Open command prompt/terminal on the project root directory and execute the following commands.
nodejs node_modules/node-sass/scripts/install.js
npm rebuild node-sass
I have tried to package my electron app on mac using electron-builder. There are no errors while doing so, however, once I try to open the app I get the following error:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: EACCES: permission denied, mkdir
I have not found any similar errors related to electron-builder and it also works just fine for windows. I have also tried 'sudo'.
Thanks in advance for any help.
First, try uninstalling electron with the npm uninstall command.
sudo npm uninstall -g electron
Then reinstall electron with
sudo npm install -g electron --unsafe-perm=true --allow-root
If that doesn't work, you can do the same with node.
sudo npm install -g --unsafe-perm
I attempted to do a sudo npm install -g appium on Mac OS 10.12.5.
I get this error:
info Chromedriver Install Installing Chromedriver version '2.30' for platform 'mac' and architecture '64'
info Chromedriver Install Opening temp file to write chromedriver_mac64 to...
Error: EACCES: permission denied, mkdir
'/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/2017820-44752-12jfqpb.z2hd'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver#3.0.1 install: node install-npm.js
npm ERR! Exit status 1
npm ERR!
this is not a dup question, as this install attempt was with sudo, as the other one was not.
sudo npm install -g appium --unsafe-perm=true --allow-root
Worked for me
you are using npm so you have to use
sudo npm install --unsafe-perm
In unsafe mode with every command you run
hopefully, it will help
The -g option means install globally. When packages are installed globally, EACCES permission errors can occur.
Consider setting up npm to operate globally without elevated permissions. See Resolving Permission Errors for more information.
Option 1
The best way to avoid permission issues is to reinstall NodeJS and npm using a node version manager.
1. Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
You can close and reopen the terminal ou just open another terminal and check if nvm is installed properly with this command: command -v nvm.
2. To download and install the latest LTS release of NodeJS, run:
nvm install --lts
3. Set the newly installed NodeJS as the default environment:
nvm alias default lts/*
Option 2 (Does not apply for windows)
Change the owner of npm's directories to the current user:
sudo chown -R $(your_user) /usr/local/{lib/node_modules,bin,share}
sudo chown -R $(your_user) ~/.npm ~/.npmrc
I reinstalled Node/NPM. Problem solved.
$ yo meanjs
Error: EACCES, permission denied '/home/pain/.config/configstore/insight-yo.json'
You don't have access to this file.
What is it? What I must doing?
Verify you have all the requirements properly installed and updated:
$ sudo npm install -g yo
$ sudo npm install -g generator-meanjs
If that doesn't work, please post the entire error message —in text, not screengrab.