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

@electron/get suppresses 404 error #125

Closed
NaridaL opened this issue Nov 2, 2019 · 7 comments · Fixed by #145
Closed

@electron/get suppresses 404 error #125

NaridaL opened this issue Nov 2, 2019 · 7 comments · Fixed by #145
Labels

Comments

@NaridaL
Copy link

NaridaL commented Nov 2, 2019

After the issues in #124 I abandoned electron-download in favor of setting ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" as described in https://electronjs.org/docs/tutorial/installation#custom-mirrors-and-caches.

After figuring out to also set DEBUG=*, I got the following log...

2019-11-02T20:26:37.230Z @electron/get:index Checking the cache for electron-v7.0.0-win32-x64.zip (https://npm.taobao.org/mirrors/electron/v7.0.0/electron-v7.0.0-win32-x64.zip)
2019-11-02T20:26:47.144Z @electron/get:index Cache miss
2019-11-02T20:26:47.221Z @electron/get:index Downloading https://npm.taobao.org/mirrors/electron/v7.0.0/electron-v7.0.0-win32-x64.zip to C:\Users\aval\AppData\Local\Temp\electron-download-DId6EI\electron-v7.0.0-win32-x64.zip with options: undefined
(node:8096) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, lstat 'C:\Users\aval\AppData\Local\Temp\electron-download-DId6EI\electron-v7.0.0-win32-x64.zip'
warning.js:27
(node:8096) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
warning.js:27
(node:8096) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
warning.js:27

It took setting a breakpoint on all exceptions, to figure out the underlying issue has nothing to do with permissions, but that the constructed URL is invalid, because https://npm.taobao.org/mirrors/electron/ doesn't include vs in front of the version! This leads to a HTTP 404, but it isn't logged anywhere.

The docs should be improved and something done so that mirrors URLs can be used interchangeably, but in any case, electron/get needs to log HTTP errors.

@ivysrono
Copy link

ivysrono commented Nov 6, 2019

6.x are OK.

@vingel
Copy link

vingel commented Nov 12, 2019

When I use 'npm i elelctron@7.1.1' with ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/, it leads to a response code 404 not found error

Here is I how I fix it for temporary:

  1. Edit node_modules/@electron/get/dist/cjs/artifact-utils.js
  2. edit line 39:
var path = mirrorVar('customDir', opts, details.version);
var path = mirrorVar('customDir', opts, details.version.replace(/v\./, '');

then run npm i electron@7.1.1 again.

@xland
Copy link

xland commented Nov 29, 2019

@vingel

I test it just now.
This method doesn't help me.

@xland
Copy link

xland commented Nov 29, 2019

How about this issue's progress?

@MarshallOfSound
Copy link
Member

I can't reproduce this @NaridaL. I get the appropriate 404 error in console when I test on my machine.

image

@deangoku
Copy link

deangoku commented Jan 31, 2020

@MarshallOfSound
It can only be reproduced on windows

@electron-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.7.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants