社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
//进行命令之前,先换成淘宝的源
npm config set registry https://registry.npm.taobao.org
vue init simulatedgreg/electron-vue my-project
cd my-project
npm install
npm run dev
npm install过程中,还有个坑(顺利安装的可以忽略此步)
报错:electron@2.0.18 postinstall: `node install.js`
解决方法:在npmrc文件(这个文件在你nodejs的安装目录里,我的在这里E:solf_downnodenode_modulesnpmnpmrc)中添加,完美解决
electron_mirror="https://npm.taobao.org/mirrors/electron/"
当你用electron-vue创建好项目后,npm run dev运行时,报错
解决方法:直接在index.ejs中把下图的红框的代码去除掉,就行了。没有什么影响
也可以在https://github.com/SimulatedGREG/electron-vue/issues/871 看看其他解决方法
成功运行!
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!