-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again #8466
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
Comments
That's generally a really bad idea. Does your NPM/Node environment work without admin mode? |
I mean, have you tried doing what the error suggests and and deleting "node_modules/electron" and trying again? |
@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:
|
@enlight I have installed multiple global instances, and they work correctly. I rarely have to install them with an administrator. |
@LizanLycan It remains on |
@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. |
Try npm install electron --verbose It should output a progress bar for the download 👍 |
@MarshallOfSound Thank you very much. I can now see the download progress. I'll wait until I finish and comment. 👍 |
@MarshallOfSound electron@1.4.15 postinstall C:\Users\Lizandro Zerpa\AppData\Roaming\npm\node_modules\electron Downloading electron-v1.4.15-win32-x64.zip Error: read ECONNRESET npm ERR! electron@1.4.15 postinstall: npm ERR! Please include the following file with any support request: |
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 |
Can't find a solution for this -
/home/nikhil/workspace/electron_demo/electron-quick-start/node_modules/electron/index.js:9 Error: Electron failed to install correctly, please delete node_modules/electron and try installing again npm ERR! Linux 4.4.0-59-generic npm ERR! Please include the following file with any support request: |
@MarshallOfSound helped me to correct this by observing the download and installation process with:
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. |
@LizanLycan Please help...I've tried everything... |
the modules dir include install.js, run and install it, the path.txt is written. It works |
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. |
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. |
@LizanLycan + @manojvignesh - awesome suggestion! |
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again |
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ijry you tried install with |
This comment has been minimized.
This comment has been minimized.
none useful , i try gooogle and google , never worked................................. |
This solved my issue:
Seems that you have to have a version of pre-built electron installed in same project. |
cnpm install electron -g --verbose |
Been waiting, but I seem to see him fail to find the installer. F:\test\electron-quick-start>npm install electron --verbose
|
I found a way in Chinese region. Step 1. npm install electron Finaly, you can run npm start. But, it is not a good way to start electron. |
Give it a try. 🤓 |
I have tried to follow most of the guidelines and everything installs correctly but I still get the same issue. |
If you are Chinese the following instructions may be useful to you.
最好的方法还是使用淘宝镜像:
版本根据自己的需求来 |
Solved on raspberry Pi4 with: |
If you use webpack to build project, you should add electron to the externals of your webpack config . |
on Mac after installing electron, try:
*sudo required |
Your suggestion solved my issue. But do we need to install both Electron@latest and electron-prebuilt@1.4.13 ?? |
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. |
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 : ( |
Node install.js was failing due to permissions for me so the following solved my issue.
No need to download prebuilt binaries or older versions of electron. |
thanks! It maked my project worked! |
Give it a try. 🤓 Open https://github.com/pangxieju/electron-fix 1、$ npm install electron-fix -D 2、Edit file ‘package.json’ 3、npm run fix |
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
Doing the following fixed my issue:
Since i installed globally, I used the install.js located in the global install directory, |
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. |
what's the details of this step |
Do Any of the following. It Work for me.
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. |
For M1 Mac, this somehow worked:
|
If you skip download sometimes by You might forget to unset it back on CI. ( in my case, gitlab-runner ci )
if it still not working, edit some and run |
Had the same issue on windows 10 Reason (I assume): Solution: |
document my solution; first you can debug in /node_modules/electron run 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: the code : rewrite this line and in this file code: rewrite this code:
then run command in /node_modules/electron then you can start your app in main folder;
this may help someone met the same error like me; |
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 |
Uh oh!
There was an error while loading. Please reload this page.
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!
The text was updated successfully, but these errors were encountered: