Closed daydayhappychao closed 4 years ago
Where are you finding the instructions to use https://npm.taobao.org/mirrors/electron/ ? On https://www.electronjs.org/docs/tutorial/installation#custom-mirrors-and-caches it says to use https://cdn.npm.taobao.org/dist/electron/ .
fix!
@Magin-CC It would still help to know where you found the first mirror URL, to see if it can be updated.
@malept probably people get the first invalid mirror URL from the official mirror instruction. In the document:
ELECTRON_MIRROR="https://cdn.npm.taobao.org/dist/electron/"
is ok for download, but the second part
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
ELECTRON_CUSTOM_DIR="{{ version }}"
is not able for download because the workable customDir is in fact v{{ version }}
. To be honest, the instruction is somehow misleading. Many people(me included) are anxious to find a solution and will not read the instructions carefully at first glance.
env: MacOS I just set
electron_mirror=https://npm.taobao.org/mirrors/electron/
in ~/.npmrc, I executednpm i electron --save
in my project, and I got an errorI make it work by change the source code at
node_modules/@electron/get/dist/cjs/artifact-util.js: 33 getArtifactRemoteURL
like this:This is a bad way, please fix it!