Skip to content

Instantly share code, notes, and snippets.

@ZhouHansen
Last active February 19, 2019 07:26
Show Gist options
  • Save ZhouHansen/a851505306c41db211d4536af8434d70 to your computer and use it in GitHub Desktop.
Save ZhouHansen/a851505306c41db211d4536af8434d70 to your computer and use it in GitHub Desktop.
Solutions for unexpected problems from using electron
If you are in china:
❌ `npm install electron`
❌ `npm run build`
✅ `ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm install electron`
✅ `ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm run build`
For windows command line:(no space between two command)
✅ `set ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/&&npm run build`
If `fs-events` error hits you, e.g. when you use chokidar:
❌ `npm install`
✅ `npm install --no-optional`
If you use `electron-builder` and windows, you need to download and put some files to the right place:
https://blog.csdn.net/bailong1/article/details/78657605
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment