Comments (17)
had the same problem.
Solved with this:
rm -Rf ~/.electron/
then it worked
sudo npm install electron-prebuilt -g
from electron-prebuilt.
sudo npm install -g electron-prebuilt --unsafe-perm=true --allow-root
The error is on "El Capitan" OSX 10.11.4
from electron-prebuilt.
I solved this problem by removing sudo
from electron-prebuilt.
#139 you can look this problem, I fixed it use
sudo npm install -g electron --unsafe-perm=true --allow-root
@AshrafBasry
from electron-prebuilt.
I solved by npm install locally ;then, npm global intall again
from electron-prebuilt.
Thanks jctovar, that worked for me. This should be fixed or documented somewhere
from electron-prebuilt.
Ебаное говно!
#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.
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.
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.
Any update on this? I even totally reinstalled node but the problem seems to remain.
from electron-prebuilt.
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:
- it downloads the zip into
require('os').tmpdir()
, which should be readable and writable by your user https://github.com/maxogden/electron-download/blob/master/index.js#L37 - when its done download it moves the zip into the electron zip cache folder (usually
~/.electron
) https://github.com/maxogden/electron-download/blob/master/index.js#L45
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.
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.
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.
This was fixed at some point.
from electron-prebuilt.
Thank you ariu! It worked :)
from electron-prebuilt.
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.
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)
- OpenBSD as a supportet platform? HOT 2
- Unable to install Electron with the quick-start tutorial HOT 7
- "sudo npm install -g electron" fails HOT 1
- Electron not installing (Windows 10) HOT 2
- Got stuck after npm install -g HOT 1
- Error while installing npm in windows 10 HOT 1
- Mac: Failed at the [email protected] postinstall script 'node install.js'. HOT 4
- npm install hangs HOT 3
- Dependency to @types/node makes electron package incompatible with typescript projects not using commonjs HOT 11
- Can't install electron 1.7.1 locally using npm 5 HOT 10
- Install on Bash on Ubuntu on Windows (WSL) HOT 13
- Postinstall script failing HOT 22
- Error: Generated checksum for "electron-v1.4.13-linux-x64.zip" did not match expected checksum. HOT 11
- Prebuilt electron package for Ubuntu 10.04 32 bits HOT 1
- node (vs. nodejs) is required when installing electron HOT 5
- Can't install in Windows10 HOT 1
- Change electron binary path via environment variable? HOT 2
- Electron not installing on Mac Os High Sierra HOT 1
- npm ERR! [email protected] postinstall
- Error while installing electron on Mac
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-prebuilt.