Mohamad AlJasem
Mohamad AlJasem

Reputation: 386

can't install electron globally

I am trying to install electron globally , but I am facing this annoying error message


/home/tbh/.npm-global/bin/electron -> /home/tbh/.npm-global/lib/node_modules/electron/cli.js

> [email protected] postinstall /home/tbh/.npm-global/lib/node_modules/electron
> node install.js

/home/tbh/.npm-global/lib/node_modules/electron/install.js:54
  throw err
  ^

Error: EACCES: permission denied, mkdir '/home/tbh/.npm-global/lib/node_modules/electron/dist'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have tried several things including running this with sudo and changing NPM configuration accrediting to this Question on Stackoverflow But nothing worked for me if anybody needs the log for this problem you can find it here here PS: my OS is Ubuntu 18.04

Upvotes: 2

Views: 1877

Answers (1)

Joshua
Joshua

Reputation: 5322

Try installing with: sudo npm install -g electron --unsafe-perm=true --allow-root instead.

Source: https://github.com/electron/electron/issues/10604#issuecomment-333368230

Upvotes: 7

Related Questions