-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Electron failed to install correctly, please delete node_modules/electron and try installing again #20994
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
We require the template to be filled out on all new issues and pull requests. We do this so that we can be certain we have all the information we need to address your submission efficiently. This allows the maintainers to spend more time fixing bugs, implementing enhancements, and reviewing and merging pull requests. We will be able to more closely look at your issue once you do so. |
Follow your approach ,It's the same problem @Legends but reduced version can be used. I use 6.x version。 |
@codebytere Do you need more information? |
Same here. Would it be safe if I copy that folder from one of my old projects to the new one? Thanks. |
|
it is OK for Mac, create file |
Same error here if I try to install electron v7.1.2. |
我是这样重现该问题的,求解决
|
I found a way in Chinese region. Step 1. Finaly, you can run But, it is not a good way to start electron. |
On Linux: I was getting this error while installing electron because i had no acces to modify "/home/{user}/.cache/electron" directory. Removing that directory and reinstalling electron worked to me. |
Give it a try. 🤓 |
error fixed, but electron doesnt start |
I thought I had the same issue. |
i have the same problem, what's happend? the new version was released without test fully? |
I have the same problem also, i tried to delete node_modules many times and install electron with npm and yarn, also I tried different versions of electrons and get the same error ! |
Navigating to installed "node_modules/electron" location and running "sudo node install.js" solved this issue for me. Electronv7.1.10 is running successfully now. |
Update
下载的缓存文件保存在了如下目录 |
How about use this mirror? |
Give it a try. 🤓 |
Give it a try. 🤓 |
Can we get a first party solution for this? It's really negligent to push untested and broken code that was discovered 4 months ago and it still be a problem. I could understand if it didn't effect devs in prod, but it does. |
The docs have been updated to explain how to configure HTTP mirrors for Electron 7.0.0 and above: https://www.electronjs.org/docs/tutorial/installation#mirror |
@malept
because i am using but unfortunately |
You can set the environment variable |
@malept
|
The installation docs contains instructions on how to configure proxy support. |
@malept sorry for the weird proxy problem. i rebooted my computer and the proxy problem is gone now and |
It's not clear that you're setting the Also, |
try: |
I solved.
thanks @malept @bruceauyeung @youngyou |
Are you sure the address is correct? This address response: <Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<RequestId>5E62F87C1897B339345537B9</RequestId>
<HostId>cdn.npm.taobao.org</HostId>
<Key>dist/electron/</Key>
</Error> I think it should be |
Yes, I test it. Try: and npm install detail:
|
Suggest use With eg:
Beacuse the dist url dist is different
Maybe the high version of electron's script modify the default dir. |
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 |
Thanks ,I'll try it later. |
@malept i set |
|
try add this env variable |
我这边已经按照提示删除依赖重新安装 ,结果还是一直报这个错误
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (E:\学习资料\前端材料\设计模式\code\nodeJS脚本\npm-login\node_modules_electron@7.1.0@electron\index.js:14:11)
at Object. (E:\学习资料\前端材料\设计模式\code\nodeJS脚本\npm-login\node_modules_electron@7.1.0@electron\index.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object. (E:\学习资料\前端材料\设计模式\code\nodeJS脚本\npm-login\node_modules_electron@7.1.0@electron\cli.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:936:30)
The text was updated successfully, but these errors were encountered: