环境win10 64位
npm config list 查看 .npmrc文件的位置修改
registry=https://registry.npm.taobao.org
electron_mirror="https://npm.taobao.org/mirrors/electron/"
或者直接
npm config set registry https://registry.npm.taobao.org/
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
vue init simulatedgreg/electron-vue my-project
cd my-project
npm install
npm run dev
npm run dev报错,把index.ejs中的代码去除掉下面代码
<% if (!process.browser) { %>
<script>
if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
</script>
<% } %>
参考https://blog.csdn.net/sinat_19594515/article/details/103694805
https://github.com/SimulatedGREG/electron-vue/issues/871
npm run build的时候winCodeSign下载出错,试了好几遍都不行,查网上资料,没办法手动下载
手动下载winCodeSign-2.4.0.zip文件
https://github.com/electron-userland/electron-builder-binaries/releases/tag/winCodeSign-2.4.0
复制到C:\Users\****\AppData\Local\electron-builder\Cache\winCodeSign
手动下载nsis-3.0.3.2文件
https://github.com/electron-userland/electron-builder-binaries/releases/tag/nsis-3.0.3.2
复制到C:\Users\****\AppData\Local\electron-builder\Cache\nsis
参考 https://segmentfault.com/a/1190000018533945
这2个资源实际下载还是很慢,自己弄了个压缩文件,https://download.csdn.net/download/ren062/12707594