Skip to content
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

install electron with Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/electron/electron-tmp-download-4860-1517066058438' #11755

Closed
wan-ghuan opened this issue Jan 27, 2018 · 15 comments

Comments

@wan-ghuan
Copy link

node -v
v8.9.4
npm -v
5.6.0
sudo npm install electron -g
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> electron@1.7.11 postinstall /usr/lib/node_modules/electron
> node install.js

/usr/lib/node_modules/electron/install.js:48
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/electron/electron-tmp-download-4860-1517066058438'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.7.11 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@1.7.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@welcome
Copy link

welcome bot commented Jan 27, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@MarshallOfSound
Copy link
Member

You need to set the permissions of /usr/lib/node_modules to be writable by your user.

For more info on these NPM errors please see: Troubleshooting Installation

@thangntt
Copy link

npm install -g electron --unsafe-perm=true --allow-root

@obendesmond
Copy link

@wan-ghuan try this
sudo npm install -g electron --unsafe-perm=true.

Hope that helped

@pawanraocse
Copy link

sudo npm install -g electron --unsafe-perm=true --allow-root
This helped to solve the issue, thanks

@jesobreira
Copy link

I still have this issue and the command posted by @obendesmond also worked.
What I find interesting is that I have had that issue on my Ubuntu 18.04 notebook, my Macbook Pro and two newly-created Ubuntu AWS instances, completely different environments, which makes me think a huge portion of the users may be facing this issue as well. Obviously I may be wrong, but here I leave the question: isn't the portion of the environments where the unsafe-perm switcher too expressive enough to make a point on the documentation about it (to save new users from some Googling)? Or actually the environments where this is required are inexpressive (and I'm just out of luck)?

@alvaromoli
Copy link

npm install -g electron --unsafe-perm=true --allow-root

npm install -g electron --unsafe-perm=true --allow-root

It worked! Thanks!

@aniruddhashevle
Copy link

It works for the 1st time only. After again reopening the app, it still shows the error EACCES: permission denied!

@jewel-rana
Copy link

You need to set the permissions of /usr/lib/node_modules to be writable by your user.

For more info on these NPM errors please see: Troubleshooting Installation

Thats worked for me

@dav1dnix
Copy link

npm install -g electron --unsafe-perm=true --allow-root

thank you! This worked 😄

@extremepayne
Copy link

extremepayne commented Dec 30, 2019

On my Debian stretch Chromebook subsystem-thingy, I had the same issue; solved via sudo npm install electron -g --unsafe-perm=true --allow-root. I totally agree with @jesobreira this should go in the docs. If you need more evidence of other users facing similar issues, look no further than #10362, npm/npm#17268, and https://stackoverflow.com/questions/47247443/electron-js-install-error-error-eacces-permission-denied (some comments on the second link have over 500 +1s). I'll try and figure out where it should go and then open a PR.

@itsmyCareer
Copy link

npm install -g electron --unsafe-perm=true --allow-root

This problem is solved, too! THX :)

jamestimotiwu referenced this issue in jamestimotiwu/trim_app Jun 27, 2020
@chiglish
Copy link

@wan-ghuan try this
sudo npm install -g electron --unsafe-perm=true.

Hope that helped

It worked .thx

@jimbo8098
Copy link

unsafe-perm worked for me too. I've never touched that directory myself, only through apt so I'm a little confused. Electron was also already there previously, I needed to reinstall it following an attempt to install bue-devtools.

@Marcosul
Copy link

for me needed sudo

$ sudo npm install -g electron --unsafe-perm=true --allow-root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests