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

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again #8466

Closed
LizanLycan opened this issue Jan 21, 2017 · 61 comments
Labels
blocked/need-info ❌ Cannot proceed without more information

Comments

@LizanLycan
Copy link

LizanLycan commented Jan 21, 2017

  • Electron version: latest (That Try)
  • Operating system: Microsoft Windows [Versión 10.0.10586]

Expected behavior

Install from "npm" on Windows

Actual behavior

I can not use Electron because it is not installed correctly, despite using the shell in administrator mode. Note that when installing dependencies, it does not finish displaying the dependency tree that normally shows "npm".

How to reproduce

git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install
npm start

> electron-quick-start@1.0.0 start PATH\electron-quick-start
> electron .

PATH\electron-quick-start\node_modules\electron\index.js:9
throw new Error('Electron failed to install correctly, please delete node_modules/' + path.basename(__dirname) + ' and try installing again')
^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object.<anonymous> (PATH\electron-quick-start\node_modules\electron\index.js:9:9)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (PATH\electron-quick-start\node_modules\electron\cli.js:3:16)
at Module._compile (module.js:570:32)

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\Users\\{user_name}\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start@1.0.0 start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script 'electron .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron-quick-start
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron-quick-start
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! PATH\electron-quick-start\npm-debug.log

npm-debug.txt

THANKS!

@enlight
Copy link
Contributor

enlight commented Jan 22, 2017

despite using the shell in administrator mode

That's generally a really bad idea. Does your NPM/Node environment work without admin mode?

@MarshallOfSound
Copy link
Member

I mean, have you tried doing what the error suggests and and deleting "node_modules/electron" and trying again?

@MarshallOfSound MarshallOfSound added the blocked/need-info ❌ Cannot proceed without more information label Jan 22, 2017
@LizanLycan
Copy link
Author

@MarshallOfSound That's right, I did it several times.

It seems strange to me one thing, during the installation of modules, apparently does not finish correctly, because it remains as follows:

$ npm install

> electron@1.4.15 postinstall C:\Users\Lizandro Zerpa\Desktop\SisTelSim\SisTelSim_Dev\electron-quick-start\node_modules\electron
> node install.js
(It remains on hold)

@LizanLycan
Copy link
Author

@enlight I have installed multiple global instances, and they work correctly. I rarely have to install them with an administrator.

@MarshallOfSound
Copy link
Member

@LizanLycan It remains on node install.js while it downloads Electron. Please let it finish and don't cancel it halfway through.

@LizanLycan
Copy link
Author

@MarshallOfSound Ok that's what I've been doing. I was looking for the size of the package to give me an idea of ​​how long it might take, but I did not get it. I left it for over 1 hour. Still waiting, thanks for the comment.

@MarshallOfSound
Copy link
Member

Try

npm install electron --verbose

It should output a progress bar for the download 👍

@LizanLycan
Copy link
Author

@MarshallOfSound Thank you very much. I can now see the download progress. I'll wait until I finish and comment. 👍

@LizanLycan
Copy link
Author

@MarshallOfSound
Apparently little hard joy.

electron@1.4.15 postinstall C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
node install.js

Downloading electron-v1.4.15-win32-x64.zip
Error: read ECONNRESET
C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron\install.js:46
throw err
^

Error: read ECONNRESET
at exports._errnoException (util.js:1022:11)
at TLSWrap.onread (net.js:569:26)
npm verb lifecycle electron@1.4.15postinstall: unsafe-perm in lifecycle true
npm verb lifecycle electron@1.4.15
postinstall: PATH: C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron\node_modules.bin;C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules.bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Skype\Phone;C:\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Users\Lizandro Zerpa.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Ruby22-x64\bin;C:\MinGW\bin;C:\MinGW\msys\bin\1.0;C:\Users\Lizandro Zerpa\AppData\Roaming\npm
npm verb lifecycle electron@1.4.15postinstall: CWD: C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm info lifecycle electron@1.4.15
postinstall: Failed to exec postinstall script
npm verb unlock done using C:\Users\Lizandro Zerpa\AppData\Roaming\npm-cache_locks\staging-d38db31138d15c28.lock for C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules.staging
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb gentlyRm don't care about contents; nuking C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron
npm verb stack Error: electron@1.4.15 postinstall: node install.js
npm verb stack Exit status 1
npm verb stack at EventEmitter. (C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
npm verb stack at emitTwo (events.js:106:13)
npm verb stack at EventEmitter.emit (events.js:191:7)
npm verb stack at ChildProcess. (C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
npm verb stack at emitTwo (events.js:106:13)
npm verb stack at ChildProcess.emit (events.js:191:7)
npm verb stack at maybeClose (internal/child_process.js:877:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid electron@1.4.15
npm verb cwd C:\Users\Lizandro Zerpa\Desktop\SisTelSim\SisTelSim_Dev\electron-quick-start
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\nodejs\node.exe" "C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "electron" "-g" "--verbose"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE

npm ERR! electron@1.4.15 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.4.15 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Lizandro Zerpa\Desktop\SisTelSim\SisTelSim_Dev\electron-quick-start\npm-debug.log

@MarshallOfSound
Copy link
Member

Looks like you're having some network issues (which are out of our control 😢 )

You can download the ZIP file manually in your browser from here and place it in your C:\Users\<username>\.electron folder. Then it won't need to download itself 👍

@nikparmar
Copy link

Can't find a solution for this -
m WARN lifecycle electron@1.4.15~postinstall: cannot run in wd %s %s (wd=%s) electron@1.4.15 node install.js /home/nikhil/workspace/electron_demo/electron-quick-start/node_modules/electron
electron-quick-start@1.0.0 /home/nikhil/workspace/electron_demo/electron-quick-start
-- electron@1.4.15 +-- electron-download@3.2.0 | +-- debug@2.6.0 | | -- ms@0.7.2
| +-- fs-extra@0.30.0
| | +-- graceful-fs@4.1.11
| | +-- jsonfile@2.4.0
| | +-- klaw@1.3.1
| | +-- path-is-absolute@1.0.1
| | -- rimraf@2.5.4 | | -- glob@7.1.1
| | +-- fs.realpath@1.0.0
| | +-- inflight@1.0.6
| | | -- wrappy@1.0.2 | | +-- minimatch@3.0.3 | | | -- brace-expansion@1.1.6
| | | +-- balanced-match@0.4.2
| | | -- concat-map@0.0.1 | | -- once@1.4.0
| +-- home-path@1.0.3
| +-- minimist@1.2.0
| +-- nugget@2.0.1
| | +-- pretty-bytes@1.0.4
| | | +-- get-stdin@4.0.1
| | | -- meow@3.7.0 | | | +-- camelcase-keys@2.1.0 | | | | -- camelcase@2.1.1
| | | +-- decamelize@1.2.0
| | | +-- loud-rejection@1.6.0
| | | | +-- currently-unhandled@0.4.1
| | | | | -- array-find-index@1.0.2 | | | | -- signal-exit@3.0.2
| | | +-- map-obj@1.0.1
| | | +-- normalize-package-data@2.3.5
| | | | +-- hosted-git-info@2.1.5
| | | | +-- is-builtin-module@1.0.0
| | | | | -- builtin-modules@1.1.1 | | | | -- validate-npm-package-license@3.0.1
| | | | +-- spdx-correct@1.0.2
| | | | | -- spdx-license-ids@1.2.2 | | | | -- spdx-expression-parse@1.0.4
| | | +-- object-assign@4.1.1
| | | +-- read-pkg-up@1.0.1
| | | | +-- find-up@1.1.2
| | | | -- read-pkg@1.1.0 | | | | +-- load-json-file@1.1.0 | | | | | +-- parse-json@2.2.0 | | | | | | -- error-ex@1.3.0
| | | | | | -- is-arrayish@0.2.1 | | | | | +-- pify@2.3.0 | | | | | -- strip-bom@2.0.0
| | | | | -- is-utf8@0.2.1 | | | | -- path-type@1.1.0
| | | +-- redent@1.0.0
| | | | +-- indent-string@2.1.0
| | | | | -- repeating@2.0.1 | | | | | -- is-finite@1.0.2
| | | | -- strip-indent@1.0.1 | | | -- trim-newlines@1.0.0
| | +-- progress-stream@1.2.0
| | | +-- speedometer@0.1.4
| | | -- through2@0.2.3 | | | +-- readable-stream@1.1.14 | | | | -- isarray@0.0.1
| | | -- xtend@2.1.2 | | | -- object-keys@0.4.0
| | +-- request@2.79.0
| | | +-- aws-sign2@0.6.0
| | | +-- aws4@1.5.0
| | | +-- caseless@0.11.0
| | | +-- combined-stream@1.0.5
| | | | -- delayed-stream@1.0.0 | | | +-- extend@3.0.0 | | | +-- forever-agent@0.6.1 | | | +-- form-data@2.1.2 | | | | -- asynckit@0.4.0
| | | +-- har-validator@2.0.6
| | | | +-- chalk@1.1.3
| | | | | +-- ansi-styles@2.2.1
| | | | | +-- escape-string-regexp@1.0.5
| | | | | +-- has-ansi@2.0.0
| | | | | -- supports-color@2.0.0 | | | | +-- commander@2.9.0 | | | | | -- graceful-readlink@1.0.1
| | | | -- is-my-json-valid@2.15.0 | | | | +-- generate-function@2.0.0 | | | | +-- generate-object-property@1.2.0 | | | | | -- is-property@1.0.2
| | | | +-- jsonpointer@4.0.1
| | | | -- xtend@4.0.1 | | | +-- hawk@3.1.3 | | | | +-- boom@2.10.1 | | | | +-- cryptiles@2.0.5 | | | | +-- hoek@2.16.3 | | | | -- sntp@1.0.9
| | | +-- http-signature@1.1.1
| | | | +-- assert-plus@0.2.0
| | | | +-- jsprim@1.3.1
| | | | | +-- extsprintf@1.0.2
| | | | | +-- json-schema@0.2.3
| | | | | -- verror@1.3.6 | | | | -- sshpk@1.10.2
| | | | +-- asn1@0.2.3
| | | | +-- assert-plus@1.0.0
| | | | +-- bcrypt-pbkdf@1.0.0
| | | | +-- dashdash@1.14.1
| | | | | -- assert-plus@1.0.0 | | | | +-- ecc-jsbn@0.1.1 | | | | +-- getpass@0.1.6 | | | | | -- assert-plus@1.0.0
| | | | +-- jodid25519@1.0.2
| | | | +-- jsbn@0.1.0
| | | | -- tweetnacl@0.14.5 | | | +-- is-typedarray@1.0.0 | | | +-- isstream@0.1.2 | | | +-- json-stringify-safe@5.0.1 | | | +-- mime-types@2.1.14 | | | | -- mime-db@1.26.0
| | | +-- oauth-sign@0.8.2
| | | +-- qs@6.3.0
| | | +-- stringstream@0.0.5
| | | +-- tough-cookie@2.3.2
| | | | -- punycode@1.4.1 | | | +-- tunnel-agent@0.4.3 | | | -- uuid@3.0.1
| | +-- single-line-log@1.1.2
| | | -- string-width@1.0.2 | | | +-- code-point-at@1.1.0 | | | +-- is-fullwidth-code-point@1.0.0 | | | | -- number-is-nan@1.0.1
| | | -- strip-ansi@3.0.1 | | | -- ansi-regex@2.1.1
| | -- throttleit@0.0.2 | +-- path-exists@2.1.0 | | -- pinkie-promise@2.0.1
| | -- pinkie@2.0.4 | +-- rc@1.1.6 | | +-- deep-extend@0.4.1 | | +-- ini@1.3.4 | | -- strip-json-comments@1.0.4
| +-- semver@5.3.0
| -- sumchecker@1.3.0 | -- es6-promise@4.0.5
-- extract-zip@1.6.0 +-- concat-stream@1.5.0 | +-- inherits@2.0.3 | +-- readable-stream@2.0.6 | | +-- core-util-is@1.0.2 | | +-- isarray@1.0.0 | | +-- process-nextick-args@1.0.7 | | +-- string_decoder@0.10.31 | | -- util-deprecate@1.0.2
| -- typedarray@0.0.6 +-- debug@0.7.4 +-- mkdirp@0.5.0 | -- minimist@0.0.8
-- yauzl@2.4.1 -- fd-slicer@1.0.1
`-- pend@1.2.0

electron-quick-start@1.0.0 start /home/nikhil/workspace/electron_demo/electron-quick-start
electron .

/home/nikhil/workspace/electron_demo/electron-quick-start/node_modules/electron/index.js:9
throw new Error('Electron failed to install correctly, please delete node_modules/' + path.basename(__dirname) + ' and try installing again')
^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object. (/home/nikhil/workspace/electron_demo/electron-quick-start/node_modules/electron/index.js:9:9)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/nikhil/workspace/electron_demo/electron-quick-start/node_modules/electron/cli.js:3:16)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)

npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! electron-quick-start@1.0.0 start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script 'electron .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-quick-start package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs electron-quick-start
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls electron-quick-start
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/nikhil/workspace/electron_demo/electron-quick-start/npm-debug.log

@LizanLycan
Copy link
Author

@MarshallOfSound helped me to correct this by observing the download and installation process with:

npm install electron -g --verbose

With this command you will install global Electron. You can not cancel until the download process is complete. Delete the folder node_modules and reinstall.

@brandondtran
Copy link

brandondtran commented Feb 19, 2017

@LizanLycan
Was your solution to install electron both globally and locally? Or one or the other?

Please help...I've tried everything...

@jiangtao
Copy link

the modules dir include install.js, run and install it, the path.txt is written. It works

@brandondtran
Copy link

I figured out my problem. I had JavaScript errors in my Angular 2 components. For some reason if you have errors in your JavaScript, it'll just give you this electron installed incorrectly error.

@manojvignesh
Copy link

I had the same problem. I fixed it by removing all the folders that starts with the name electorn (around 5 were there) and ran npm install with verbose flag. npm i --verbose . Then it showed progress bar for electron binaries download and downloaded fine. It's mostly because of bad internet connection. yes, i was on a connection of 150kbps.

@ddaaggeett
Copy link

ddaaggeett commented Mar 11, 2017

@LizanLycan + @manojvignesh - awesome suggestion!
with --verbose it makes it much more obvious if you're somehow interrupting the electron module download during node_modules install

@ijry
Copy link

ijry commented Jun 7, 2017

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again

2 similar comments
@ijry

This comment has been minimized.

@ijry

This comment has been minimized.

@LizanLycan
Copy link
Author

@ijry you tried install with --vebose sentence?

@ijry

This comment has been minimized.

@ijry
Copy link

ijry commented Jun 7, 2017

none useful , i try gooogle and google , never worked.................................

@justgeek
Copy link

justgeek commented Aug 22, 2017

This solved my issue:
https://stackoverflow.com/questions/42636151/electron-failed-to-install-correctly-please-delete-node-modules-and-try-instal

npm install electron-prebuilt --save-dev

Seems that you have to have a version of pre-built electron installed in same project.

@zhenghuahou
Copy link

cnpm install electron -g --verbose

@873261648
Copy link

Been waiting, but I seem to see him fail to find the installer.

F:\test\electron-quick-start>npm install electron --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\Program Files\nodejs\node.exe',
npm verb cli 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
npm verb cli 'install',
npm verb cli 'electron',
npm verb cli '--verbose' ]
npm info using npm@6.12.0
npm info using node@v8.11.1
npm verb npm-session 5dd5cd74a42cab9c
npm http fetch GET 304 http://registry.npm.taobao.org/electron 173ms (from cache)
npm timing stage:loadCurrentTree Completed in 374ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 2ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 93ms
npm http fetch GET 304 http://registry.npm.taobao.org/@electron%2fget 61ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/extract-zip 95ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/@types%2fnode 100ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/env-paths 66ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/fs-extra 73ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/debug 77ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/global-agent 96ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/got 106ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/global-tunnel-ng 118ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/sumchecker 277ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/sanitize-filename 465ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/ms 43ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/universalify 51ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/graceful-fs 59ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/jsonfile 62ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/matcher 66ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/core-js 72ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/es6-error 80ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/roarr 83ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/semver 90ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/boolean 97ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/serialize-error 109ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/escape-string-regexp 48ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/json-stringify-safe 69ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/detect-node 72ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/semver-compare 75ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/globalthis 79ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/sprintf-js 80ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/function-bind 46ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/object-keys 58ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/define-properties 63ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/type-fest 44ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/npm-conf 53ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/tunnel 55ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/lodash 70ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/encodeurl 97ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/config-chain 42ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/pify 52ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/proto-list 48ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/ini 53ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/@sindresorhus%2fis 75ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/decompress-response 90ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/@szmarczak%2fhttp-timer 95ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/duplexer3 98ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/cacheable-request 100ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/to-readable-stream 100ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/lowercase-keys 104ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/get-stream 110ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/mimic-response 146ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/url-parse-lax 73ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/p-cancelable 982ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/defer-to-connect 44ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/clone-response 60ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/responselike 67ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/keyv 72ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/http-cache-semantics 77ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/normalize-url 81ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/pump 64ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/end-of-stream 46ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/once 48ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/wrappy 52ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/json-buffer 46ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/prepend-http 51ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/truncate-utf8-bytes 133ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/utf8-byte-length 93ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/yauzl 47ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/mkdirp 59ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/concat-stream 725ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/buffer-from 52ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/typedarray 58ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/readable-stream 59ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/inherits 64ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/isarray 61ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/core-util-is 63ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/safe-buffer 64ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/process-nextick-args 67ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/string_decoder 73ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/util-deprecate 78ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/minimist 43ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/fd-slicer 49ms (from cache)
npm http fetch GET 304 http://registry.npm.taobao.org/pend 46ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 3977ms
npm timing stage:loadIdealTree Completed in 4100ms
npm timing stage:generateActionsToTake Completed in 13ms
npm verb correctMkdir C:\Users\Administrator\AppData\Roaming\npm-cache_locks correctMkdir not in flight; initializing
npm verb makeCacheDir UID & GID are irrelevant on win32
npm verb lock using C:\Users\Administrator\AppData\Roaming\npm-cache_locks\staging-7ab5b6ace88370a8.lock for F:\test\electron-quick-start\node_modules.staging
npm timing action:extract Completed in 27ms
npm info lifecycle electron@7.1.4preuninstall: electron@7.1.4
npm info lifecycle electron@7.1.4
uninstall: electron@7.1.4
npm verb unbuild rmStuff electron@7.1.4 from F:\test\electron-quick-start\node_modules
npm info lifecycle electron@7.1.4postuninstall: electron@7.1.4
npm timing action:unbuild Completed in 16ms
npm timing action:remove Completed in 7ms
npm timing action:finalize Completed in 2ms
npm timing action:refresh-package-json Completed in 28ms
npm info lifecycle electron@7.1.4
preinstall: electron@7.1.4
npm timing action:preinstall Completed in 1ms
npm info linkStuff electron@7.1.4
npm verb linkBins [ { electron: 'cli.js' },
npm verb linkBins 'F:\test\electron-quick-start\node_modules\.bin',
npm verb linkBins false ]
npm http fetch POST 404 http://registry.npm.taobao.org/-/npm/v1/security/audits/quick 108ms
npm timing action:build Completed in 18ms
npm info lifecycle electron@7.1.4install: electron@7.1.4
npm timing action:install Completed in 2ms
npm info lifecycle electron@7.1.4
postinstall: electron@7.1.4

electron@7.1.4 postinstall F:\test\electron-quick-start\node_modules\electron
node install.js

@HarwordLiu
Copy link

I found a way in Chinese region.

Step 1. npm install electron
Step 2. download the electron zip from https://github.com/electron/electron/releases/download/v7.1.7/electron-v7.1.7-darwin-x64.zip
Step 3. copy the zip to /electron/dist
Step 4. vi ./node_modules/electron/path.txt and input /electron-v7.1.7-darwin-x64/Electron.app/Contents/MacOS/Electron

Finaly, you can run npm start.

But, it is not a good way to start electron.

@pangxieju
Copy link

Give it a try. 🤓
https://github.com/pangxieju/electron-fix

@tongisulaiman
Copy link

I have tried to follow most of the guidelines and everything installs correctly but I still get the same issue.

@mqliutie
Copy link

mqliutie commented Jan 7, 2020

If you are Chinese the following instructions may be useful to you.

  1. Open your chrome and paste the url https://github.com/electron/electron/releases/download/v7.1.7/electron-v7.1.7-darwin-x64.zip, you should change the version to correct version and this url based on macOS if your are Windows try debug install.js get the correct url

  2. Save the zip to any folder, for example, Desktop. Now your zip file path is /Users/yourname/Desktop/electron-v7.1.7-darwin-x64.zip. Note the version

  3. Open then node_modules/electron/install.js comment the following code, and add new line :

    extractFile(myPath in the second step)

// downloads if not cached
// downloadArtifact({
//   version,
//   artifactName: 'electron',
//   force: process.env.force_no_cache === 'true',
//   cacheRoot: process.env.electron_config_cache,
//   platform: process.env.npm_config_platform || process.platform,
//   arch: process.env.npm_config_arch || process.arch
// }).then((zipPath) => extractFile(zipPath)).catch((err) => onerror(err))
// Node: the new line
extractFile(myPath in the second step)
  1. Run install.js node install.js
  2. Run start script of your project : npm start

最好的方法还是使用淘宝镜像:
根目录下新建一个.npmrc文件, 文件内容

electron-mirror=https://npm.taobao.org/mirrors/electron/
electron-custom-dir=8.0.2
// 下面这个是我自己用到的.. 上面两个是针对electron的
node-sqlite3_binary_host_mirror=https://npm.taobao.org/mirrors/

版本根据自己的需求来

@DonavanMartin
Copy link

Solved on raspberry Pi4 with:
npm i -D electron --arch=armv7l

@lishoulong
Copy link

If you use webpack to build project, you should add electron to the externals of your webpack config .

@lucastlima
Copy link

lucastlima commented Jan 13, 2020

on Mac after installing electron, try:

sudo node /node_modules/electron/install.js

*sudo required

@ravivit9
Copy link

ravivit9 commented Jan 16, 2020

@justgeek,

This solved my issue:
https://stackoverflow.com/questions/42636151/electron-failed-to-install-correctly-please-delete-node-modules-and-try-instal

npm install electron-prebuilt --save-dev

Seems that you have to have a version of pre-built electron installed in same project.

Your suggestion solved my issue. But do we need to install both Electron@latest and electron-prebuilt@1.4.13 ??

@chawk
Copy link
Contributor

chawk commented Jan 24, 2020

Personally, I tried all suggestions here and nothing seemed to get past this issue. I'm on a mac and it could be a proxy issue on my end.

@gaharavara
Copy link

On windows , I was just trying out electron for the first time, went through the official docs and couldn't even run the quick-start app due to the same error, tried a lot of fixes nothing works. Going to manually copy-paste the .zip provided : (

@fonym
Copy link

fonym commented Feb 17, 2020

Node install.js was failing due to permissions for me so the following solved my issue.

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

No need to download prebuilt binaries or older versions of electron.

@callect
Copy link

callect commented Mar 7, 2020

Give it a try. 🤓
https://github.com/pangxieju/electron-fix

thanks! It maked my project worked!

@pangxieju
Copy link

Give it a try. 🤓 Open https://github.com/pangxieju/electron-fix

1、$ npm install electron-fix -D

2、Edit file ‘package.json’
"scripts": {
"fix": "electron-fix start"
}

3、npm run fix

@Bobakanoosh
Copy link

Bobakanoosh commented Mar 23, 2020

For those who aren't downloading from Hong Kong and still haven't figured out the issue, I finally noticed one of the comments in this long chain.

When I ran npm i electron -g --verbose, I noticed the following line:

npm info lifecycle electron@8.1.1~postinstall: ignored because ignore-scripts is set to true electron@8.1.1

Doing the following fixed my issue:

I don't understand enough about npm to debug the underlying issue but it seems that the Electron API Demo App is not successfully running the "postinstall": "node install.js" task. This postinstall task does get listed when running npm install --verbose but it doesn't seem to run.
After installing, I have to manually run node node_modules/electron/install.js

Since i installed globally, I used the install.js located in the global install directory, ./AppData/Roaming/npm/

@srikanthonl
Copy link

Looks like you're having some network issues (which are out of our control 😢 )

You can download the ZIP file manually in your browser from here and place it in your C:\Users\<username>\.electron folder. Then it won't need to download itself 👍

While I did not have any network issues, the issue was due to a faulty electron installation when npm install was run for the first time. Just deleted .electron-gyp folder in C:\Users<username> folder and issued nom install ad then it worked.

@SoftwareEngineerPalace
Copy link

the modules dir include install.js, run and install it, the path.txt is written. It works

what's the details of this step

@pranaymak18
Copy link

Do Any of the following. It Work for me.

  1. Change Internet Connection.
  2. Delete all electron file and then install npm insatll electron.
  3. Try to install old version of electron.

This Error is because it can't able to download "electron-v11.2.1-win32-x64.zip" file. So Change Internet Connection it work for me.

@tunecino
Copy link

tunecino commented Feb 6, 2022

For M1 Mac, this somehow worked:

npm i electron --arch=arm64

@JaosnHsieh
Copy link

JaosnHsieh commented May 3, 2022

If you skip download sometimes by ELECTRON_SKIP_BINARY_DOWNLOAD=1.

You might forget to unset it back on CI. ( in my case, gitlab-runner ci )

npx cross-env ELECTRON_SKIP_BINARY_DOWNLOAD='' yarn install works for me.

if it still not working, edit some console.log in ./node_modules/electron/install.js

and run npx cross-env ELECTRON_SKIP_BINARY_DOWNLOAD='' node ./node_modules/electron/install.js might be helpful

@sviatcraft
Copy link

sviatcraft commented Jul 25, 2022

Had the same issue on windows 10

Reason (I assume):
Bad internet connection (Download speed 15-25Mbit/s)

Solution:
I tried all the above and I think npm i --verbose helped me, but not from the first try.
Right after that, I started getting errors on another package, "geckodriver".
I asked my teammate for the whole node_modules folder, and that is how I solved all my issues.

@leolei032
Copy link

leolei032 commented Sep 16, 2022

document my solution;

first you can debug in /node_modules/electron run npm run postinstall to find where error happens;

in my condition; this failed because in this folder we should generated a file name path.txt which program need to start app;

if your folder in /node_modules/electron whithout this file;you may get the same error like me;

my soluton:
at this code -- in file /node_modules/electron/extract-zip/index.js ;

the code :
await pipeline(readStream, createWriteStream(dest, { mode: procMode })
this pipeline faild without no catch function;

rewrite this line
await pipeline(readStream, createWriteStream(dest, { mode: procMode }),(err,val)=>{ if(err){ throw new Error(err) } else { return val } })

and in this file code:
await this.extractEntry(entry)

rewrite this code:

await this.extractEntry(entry) .then( val=>{ console.log('----------------res-----------'),val }) .catch(err=>{ console.log('----------------------err----------------',err) } )

then run command in /node_modules/electron
npm run postintall
then if there has generated a new file name path.txt means you have solved this problem;

then you can start your app in main folder;

npm run start

this may help someone met the same error like me;

@xtt-nora
Copy link

xtt-nora commented Nov 1, 2023

despite using the shell in administrator mode

That's generally a really bad idea. Does your NPM/Node environment work without admin mode?

my environment is right,but i don't know if it was about mac's questions? I try many changes,but it's not useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/need-info ❌ Cannot proceed without more information
Projects
None yet
Development

No branches or pull requests