The problem
Install electoron, Throw new Error(‘Electron failed to install correctly, please delete node_modules/electron and try installing again’);
Deleting and reinstalling it doesn’t seem to work
To solve
NPM config ls -l there is no problem with the url
Solution 1
CNPM I - D [email protected]
To solve the 2
- After NRM cut taobao source
- Package. Json instead:
"install": "node ./node_modules/electron/install.js"
. - Find the BASE_URL in the header of the artifact-utils.js file and change it to the following:
const BASE_URL = 'https://npm.taobao.org/mirrors/electron/'
- Finally define the path statement at the end of the add:
.replace("v","")
- perform
npm run install
complete
reference
Segmentfault.com/a/119000002…
Segmentfault.com/a/119000001…