-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM global package install throws EACCES error #1375
Comments
Did you try this? https://docs.npmjs.com/getting-started/fixing-npm-permissions |
Yup, option 2 is my setup. And it works for some global packages (without sudo), but not for this one. |
Same here. I was trying to install |
I also get this error from time to time when installing non-global packages. Running the install command twice usually fix this. |
Not sure if that's the right thing to do, but a |
You should use sudo. Try sudo npm install -g vue-cli |
From the top:
This one was left uncategorised since 2016. In the interest of closure, as with iOSKida above, on 17627 I just tried:
It takes without incident. It is possible something in WSL was fixed along the way, but I can't finger a specific issue to dupe. It is also possible (I would say probable but we'll never know) this was #1529 and something changed in |
I have had the same problem and the @edjroot 's solution save my life!! |
There is actually a fix on the doc adressing this issue : https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory |
@therealkenc please re-open - this is still an issue i only get inside wsl. |
This is not. This didn't even make it out of need-repro. |
sure, i see that you failed to repro with
for now i've settled on moving the global npm directory elsewhere as described in https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally. leaving this here for future visitors |
wtf this worked like a charm |
This also happens repeatedly for me when installing project-local packages into node_modules; my permissions are correct, ownership is correct ( I have node 13.5.0 & npm 6.13.4. % npm install --save bcrypt
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /home/myuser/Source/myproject/node_modules/gauge
npm ERR! dest /home/myuser/Source/myproject/node_modules/.gauge.DELETE
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/home/myuser/Source/myproject/node_modules/gauge' -> '/home/myuser/Source/myproject/node_modules/.gauge.DELETE'
npm ERR! [OperationalError: EACCES: permission denied, rename '/home/myuser/Source/myproject/node_modules/gauge' -> '/home/myuser/Source/myproject/node_modules/.gauge.DELETE'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/home/myuser/Source/myproject/node_modules/gauge' -> '/home/myuser/Source/myproject/node_modules/.gauge.DELETE'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/home/myuser/Source/myproject/node_modules/gauge',
npm ERR! dest: '/home/myuser/Source/myproject/node_modules/.gauge.DELETE'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, rename '/home/myuser/Source/myproject/node_modules/gauge' -> '/home/myuser/Source/myproject/node_modules/.gauge.DELETE'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/home/myuser/Source/myproject/node_modules/gauge',
npm ERR! dest: '/home/myuser/Source/myproject/node_modules/.gauge.DELETE',
npm ERR! parent: 'myproject'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2020-01-05T22_06_01_899Z-debug.log |
this is what i experienced, i am quite sure this is not really a permission issue engshun@SHUN-PC:~$ uname -a
Linux SHUN-PC 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
engshun@SHUN-PC:~$ sudo npm install -g npm
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width
npm ERR! dest /usr/lib/node_modules/.staging/string-width-5ef4a6e1
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width' -> '/usr/lib/node_modules/.staging/string-width-5ef4a6e1'
npm ERR! [OperationalError: EACCES: permission denied, rename '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width' -> '/usr/lib/node_modules/.staging/string-width-5ef4a6e1'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width' -> '/usr/lib/node_modules/.staging/string-width-5ef4a6e1'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width',
npm ERR! dest: '/usr/lib/node_modules/.staging/string-width-5ef4a6e1'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/.staging/npm-18aca6f9/node_modules/string-width',
npm ERR! dest: '/usr/lib/node_modules/.staging/string-width-5ef4a6e1'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/engshun/.npm/_logs/2021-02-07T04_29_27_923Z-debug.log |
I've got the same error and managed to solve it following the migration to First make sure you have hyper virtualization activated and available. You will need to first make sure it is turned on in the BIOS (under advanced settings for CPU) and then activate it in Windows 10 Once you have done that, you can start update to WSL 2 following this guide Basically you will do if you use Ubuntu 20.04
The Microsoft doc also helps : https://docs.microsoft.com/en-us/windows/wsl/install-win10#update-to-wsl-2 After doing the following no more Hope it helps. P.S, as It also helps resolve this issue : #2097 is closed. I referenced it here in order for other to help resolve this issue. |
i know this issue is not exists in wsl2 but there is a reason i am not using it, so i will just leave it like this |
A brief description
NPM throws an EACCES error when installing a global package (vue-cli in my case). This happens at a random point in the install, on a random dependency. This could either be a WSL or an NPM issue, but since I can't find anything about it on the net I figured I'd go for the smaller community first :)
Expected results
The package and all its dependencies install
Actual results (with terminal output if applicable)
At a seemingly random dependency, when writing from .staging to the final node_modules folder, this happens:
Running it as root does not help, the same error comes up. I have npm global packages set up in my home folder, so root is not necessary. Gulp, for instance installed and works fine without sudo.
Your Windows build number
rs_prerelease 14965
Steps / All commands required to reproduce the error from a brand new installation
$ npm install -g vue-cli
Required packages and commands to install
nodejs 6.9.1, npm 3.10.8
The text was updated successfully, but these errors were encountered: