Closed haxpor closed 7 years ago
Same here, no idea why
I just re-test again and it works now.
I remember I executed npm set registry https://registry.npmjs.org/
and then npm install
again on electron quick start project. But still need to wait a little bit.
See if that works for you.
same here. @haxpor i did what you said, but still stuck on.
i did what @haxpor did and install has finished in about 20 minutes. thanks!
This happened to me too, I found the problem is bad internet connection to github.com, I tried to download .zip files and it just got < 10KB/s. When I switch to another ISP (download .zip about 300KB/s), the installation success within seconds.
same issue , promote:electron-quick-start CK$ npm install
electron@1.6.5 postinstall electron-quick-start/node_modules/electron node install.js
/Users/CK/Documents/github/electron/electron-quick-start/node_modules/electron/install.js:47 throw err ^
Error: connect ETIMEDOUT 52.216.1.240:443 at Object.exports._errnoException (util.js:1050:11) at exports._exceptionWithHostPort (util.js:1073:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
@CK110 That error is a network issue on your side of things, try downloading electron on a different network
@MarshallOfSound But i can npm install other package
@CK110 Sure, but the electron package downloads extra (reasonably large) binaries from github releases
I have the same problem but when I execute the "npm install" script the console show the download and extracted packages but after are frozen in other line: "node install.js".
Now are 20 minutes waiting and I received nothing still. It's normal?
Thanks!
@rogercorrea ,l try with cpm and and it works now 。maybe you can try , https://cnpmjs.org/
Looks like this was another case of flaky networks.
I had this issue too... Turned out that it was caused by version incompatibilities between my Node.js and electron. Once I changed my versions to conform to what was shown on electron website landing page (see image below), npm install
took a little over 1 second.
I ran the powershell in Admin mode, then it worked and it took about 7-8 minute to complete the installation. :)
Hey @zeke, maybe add an echo somewhere in the install.js 'downloading binaries'? I also thought it was stuck (and yes, it was another case of flaky networks). ;-)
maybe add an echo somewhere in the install.js 'downloading binaries'
I like this idea. We could even take it a step further by adding something helpful for the reader to see while waiting...
@zeke We used to show the download progress but we turned it off for some reason a while back
EDIT: https://github.com/electron-userland/electron-prebuilt/pull/202
@marshallofsound Interesting trade off, I can see why PR#202 would be merged. I'm not sure what the right way to go about this conundrum would be. On one hand, I favor silent “install” scripts. On the other, this one does download some heavier stuff. Seems to me like UX wise, and adoption wise, it makes sense to let people know that in some way. @zeke
Since this project is mainly for luring people to use electron, adding a progress bar for npm install
is vital. If I followed the guide of https://electron.atom.io/, got stuck, retired several times, googled it, and ended up here with no official solution, then how many people do you think will just give up trying Electron then?
In Short, to install election globally, I guess we can try:
$ npm uninstall -g electron
$ npm install -g --verbose electron
Done (Hopefully).
Long Story Behind: For me I encountered this issue when try to install react-devtools which needs electron (for details https://github.com/facebook/react-devtools/issues/741), so I do the following:
It seems like sudo npm
is a bad thing to do, so firstly I fix the permission issue with npm global install (see https://docs.npmjs.com/getting-started/fixing-npm-permissions) (I did Option 2), after that I executed below:
$ npm uninstall -g react-devtools
$ npm uninstall -g electron
$ npm install -g --verbose react-devtools
Then the terminal will show the downloading process:
For me it was done within 5 minutes, and then $ react-devtools
works.
So I guess for installing electron only, we can simply do $ npm install -g --verbose electron
Cheers.
Thanks @ghost, to see the download progress just use:
npm install -g --verbose electron
For me it downloaded it 10-50 kb/s probably because of bad internet connection.
add ELECTRON_MIRROR env before you run npm install electron.
# Electron mirror for China
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
# Local mirror
# Example of requested URL: http://localhost:8080/1.2.0/mksnapshot-v1.2.0-darwin-x64.zip
ELECTRON_MIRROR="http://localhost:8080/"
more information : https://github.com/electron/mksnapshot
npm install --verbose
to see the download progress
Buy an ssd, and a high speed internet connection and boom solved
Solved, you need to wait: `F:\n\electron-quick-start>npm install
electron@1.7.9 postinstall F:\n\electron-quick-start\node_modules\electron node install.js
added 152 packages in 1014.082s`
for Chinese users:
touch .npmrc
.npmrc -> electron_mirror=https://npm.taobao.org/mirrors/electron/
do this and you will see the problem npm -g --verbose install electron
, the postinstall is downloading a file and you can see the progress using --verbose
Running it on Windows 10 did just fine after opening the PowerShell as Admin and then I installed the electron package globally as @santiagoalmeidabolannos did! npm -g --verbose install electron
. It will take a while for sure but It will work.
The verbose argument actually gives you peace of mind as you can see what install.js is doing. I thought it was stuck but apparently, my college internet was slow, so it was taking time to download. Thumbs up for the idea....
It works when I run powershell in admin mode (also enabled verbose)
Downloading tmp-34484-0-electron-v3.0.0-darwin-x64.zip [===> ] 9.2% of 50.16 MB (20.4 kB/s)
node install.js
After debugging the electron/install.js
, I found my solution.
npm install electron@xxx --save-dev
.Take MacOS x64 electron@v7.0.1(latest one at 2019-11-04)as example:
download manually or using wget
from https://npm.taobao.org/mirrors/electron/7.0.1/electron-v7.0.1-darwin-x64.zip
cd ~/Library/Caches/electron/
wget https://npm.taobao.org/mirrors/electron/7.0.1/electron-v7.0.1-darwin-x64.zip
Make a weird but normalized cache folder, which is found by debugging.
# in ~/Library/Caches/electron/ mkdir this weird thing
mkdir httpsgithub.comelectronelectronreleasesdownloadv7.0.1electron-v7.0.1-darwin-x64.zip
# mv the downloaded zip into the versioned folder
mv ../electron-v7.0.1-darwin-x64.zip ./
Install in your project. Now fast as a rocket 🚀!
cd /path/to/your_project
npm install electron@7.0.1 --save-dev
Validate 🎉
# in you project folder
node_modules/.bin/electron -v
# output
# v7.0.1
npm install electron stuck on
node install.js
After debugging the
electron/install.js
, I found my solution.
- Download the electron zip from github or in China from https://npm.taobao.org/mirrors/electron/.
- In electron's default cache folder mkdir an versioned cache folder and move the zip into it.
- Goto you project folder try
npm install electron@xxx --save-dev
.- Validate: node_modules/.bin/electron -v
Take MacOS x64 electron@v7.0.1(latest one at 2019-11-04)as example:
download manually or using
wget
from https://npm.taobao.org/mirrors/electron/7.0.1/electron-v7.0.1-darwin-x64.zipcd ~/Library/Caches/electron/ wget https://npm.taobao.org/mirrors/electron/7.0.1/electron-v7.0.1-darwin-x64.zip
Make a weird but normalized cache folder, which is found by debugging.
# in ~/Library/Caches/electron/ mkdir this weird thing mkdir httpsgithub.comelectronelectronreleasesdownloadv7.0.1electron-v7.0.1-darwin-x64.zip # mv the downloaded zip into the versioned folder mv ../electron-v7.0.1-darwin-x64.zip ./
Install in your project. Now fast as a rocket 🚀!
cd /path/to/your_project npm install electron@7.0.1 --save-dev
Validate 🎉
# in you project folder node_modules/.bin/electron -v # output # v7.0.1
Use this link https://www.electronjs.org/docs/tutorial/installation#cache on how to setup the electron cache folder to setup the installation. This method actually fixed the stuck installation issue I was having in Windows.
For me(chinese user), I solved by edit ~/.npmrc
(create it if not exists:
vim ~/.npmrc
Add/Replace registry
& electron_mirror
as follow:
registry=https://registry.npm.taobao.org
electron_mirror=https://npm.taobao.org/mirrors/electron/
and save have a try
For me(Chinese user), I solved by edit
~/.npmrc
(create it if not exists:vim ~/.npmrc
Add/Replace
registry
&electron_mirror
as follow:registry=https://registry.npm.taobao.org electron_mirror=https://npm.taobao.org/mirrors/electron/
and save have a try
Thanks very much. It saved my day.
Got stuck on
I wait for it long enough before submitting this issue.
I have node
v7.4.0
, and npm4.0.5
.