Coder Social home page Coder Social logo

Comments (17)

 avatar commented on September 15, 2024 72

had the same problem.

Solved with this:
rm -Rf ~/.electron/

then it worked
sudo npm install electron-prebuilt -g

from electron-prebuilt.

jctovar avatar jctovar commented on September 15, 2024 27

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

The error is on "El Capitan" OSX 10.11.4

from electron-prebuilt.

kmsheng avatar kmsheng commented on September 15, 2024 12

I solved this problem by removing sudo

from electron-prebuilt.

Borkes avatar Borkes commented on September 15, 2024 10

#139 you can look this problem, I fixed it use
sudo npm install -g electron --unsafe-perm=true --allow-root @AshrafBasry

from electron-prebuilt.

linkSwr avatar linkSwr commented on September 15, 2024 3

I solved by npm install locally ;then, npm global intall again

from electron-prebuilt.

bumpmann avatar bumpmann commented on September 15, 2024 2

Thanks jctovar, that worked for me. This should be fixed or documented somewhere

from electron-prebuilt.

gitkv avatar gitkv commented on September 15, 2024 2

Ебаное говно!

#139 you can look this problem, I fixed it use
sudo npm install -g electron --unsafe-perm=true --allow-root @AshrafBasry

/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> [email protected] postinstall /usr/lib/node_modules/electron
> node install.js

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

Error: Failed to find Electron v1.7.8 for linux-x64 at https://github.com/electron/electron/releases/download/v1.7.8/electron-v1.7.8-linux-x64.zip
    at Request.<anonymous> (/usr/lib/node_modules/electron/node_modules/nugget/index.js:169:61)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at Request.onRequestResponse (/usr/lib/node_modules/electron/node_modules/request/request.js:1068:10)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:115:13)
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.

from electron-prebuilt.

AshrafBasry avatar AshrafBasry commented on September 15, 2024 1

sudo npm install -g electron
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron/cli.js

[email protected] postinstall /usr/local/lib/node_modules/electron
node install.js

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

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'
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.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/zero/.npm/_logs/2017-07-03T02_47_14_697Z-debug.log

Ubuntu 17.04

from electron-prebuilt.

italodeverdade avatar italodeverdade commented on September 15, 2024

I have the same problem, i'm running with sudo command but a received EACCES.

/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js

Downloading electron-v0.32.1-darwin-x64.zip
[============================================>] 100.0% of 35.97 MB (866.73 kB/s)

/usr/local/lib/node_modules/electron-prebuilt/install.js:15
throw err
    ^
Error: EACCES, rename '/usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-10443-   1441832684729/electron-v0.32.1-darwin-x64.zip'

from electron-prebuilt.

x-ji avatar x-ji commented on September 15, 2024

Any update on this? I even totally reinstalled node but the problem seems to remain.

from electron-prebuilt.

max-mapper avatar max-mapper commented on September 15, 2024

This is a hard one to reproduce, as it seems to only affect a very small number of OS X users.

What happens when you install, in a nutshell:

You can run it with DEBUG=electron-download npm i electron-prebuilt -g to see the exact names of these folders. Then you can poke around and look at the ownership on those folders to figure out whats going on.

from electron-prebuilt.

x-ji avatar x-ji commented on September 15, 2024

Yeah I guess somehow the permissions are messed up and I'm doing chmod. It seems that if I chmod not only for the user myself but also for group and others it works. Maybe others could also give it a try?

from electron-prebuilt.

justinmchase avatar justinmchase commented on September 15, 2024

I'm not a big mac guy so I'm not sure what's wrong with my environment but I'll try to add some context to see if anything helps.

Someone game me their old mac to use. There was already a main account on the mac, I was added as a user later and set as an administrator. I can sudo. Whenever I install an npm package globally I have to sudo (e.g. sudo npm install electron-prebuilt -g). Is that normal? Maybe that's the problem?

Here is the error with the debugging information you asked for:

Macintosh:revolve justin$ sudo DEBUG=electron-download npm i electron-prebuilt -g
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js

  electron-download info +0ms { cache: '/Users/justin/.electron',
  filename: 'electron-v0.32.2-darwin-x64.zip',
  url: 'https://github.com/atom/electron/releases/download/v0.32.2/electron-v0.32.2-darwin-x64.zip' }
  electron-download creating cache/tmp dirs +22ms
  electron-download downloading zip +14ms https://github.com/atom/electron/releases/download/v0.32.2/electron-v0.32.2-darwin-x64.zip to /usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-642-1442250415501
Downloading electron-v0.32.2-darwin-x64.zip
[============================================>] 100.0% of 35.97 MB (5.33 MB/s)
  electron-download moving zip to +8s /Users/justin/.electron/electron-v0.32.2-darwin-x64.zip
/usr/local/lib/node_modules/electron-prebuilt/install.js:15
  throw err
        ^
Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-642-1442250415501/electron-v0.32.2-darwin-x64.zip' -> '/Users/justin/.electron/electron-v0.32.2-darwin-x64.zip'
    at Error (native)

Info on the directories mentioned here:

Macintosh:revolve justin$ ls -la /Users/justin/.electron
drwxr-xr-x  10 justin  staff       340 Aug 26 16:25 .

Surprisingly though:

Macintosh:revolve justin$ ls -la /usr/local/lib/node_modules/electron-prebuilt
ls: /usr/local/lib/node_modules/electron-prebuilt: No such file or directory

Maybe node is cleaning it up after the failure, I'm not sure. But everthing in that node_modules folder is owned by nobody or root.

from electron-prebuilt.

justinmchase avatar justinmchase commented on September 15, 2024

This was fixed at some point.

from electron-prebuilt.

chrischang avatar chrischang commented on September 15, 2024

Thank you ariu! It worked :)

from electron-prebuilt.

gflohr avatar gflohr commented on September 15, 2024

As pointed out above sudo npm install -g electron --unsafe-perm=true --allow-root most likely fixes the problem. Alternatively, try yarn instead:

sudo yarn add global electron

from electron-prebuilt.

justinmchase avatar justinmchase commented on September 15, 2024

I just want to add that you probably no longer need to, and probably should not, install any packages globally ever again. Always prefer local install only.

To use a locally installed command use package.scripts or npx.

For both cases:

npm install electron

Then invoking it from npm, add to your package.json

{
  "scripts": {
    "electron": "electron $*"
  }
}

then

npm run electron

Or with npx:

npx electron

Avoid global installs as it will affect all repositories and you can have confusing version conflicts and you'll have to manually update it constantly if other people update the version in the repo. There is no good reason to do global installs ever again, as far as I know.

from electron-prebuilt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.