执行 package.json scripts 对应指令

$ npm run start
package.json 对应目录下
"scripts": {
"start": "node_modules/.bin/electron .",
"pack": "node_modules/.bin/electron-builder --dir",
"dist": "node_modules/.bin/electron-builder",
"postinstall": "node_modules/.bin/electron-builder install-app-deps"

$ node start.js
http://www.ruanyifeng.com/blog/2016/10/npm_scripts.html
具体操作项目
https://github.com/chanshiyucx/eriri

yarn
安装
npm install -g yarn
https://yarnpkg.com/getting-started/install
具体操作项目
https://github.com/GinirohikoCha/ChamageViewer

electron的坑: Electron failed to install correctly, please delete node_modules/electron and try installing again
解决
查看npm 配置 npm config ls -l 没有问题 在查看代码中文件报错的方法,发现url有问题
解决1
cnpm i -D electron@8.0.0
经过反复测试work_crawler 项目当前最佳方法 挂的v2rayA-http 这玩意不认识SOCKS5代(防封key)理
如果执行上面语句正常后 又执行
npm update
然后又坏了 的重新执行上面语句 才能正常 工作
官方也给出原因:淘宝镜像的问题
//
npm install electron@13.3.0
npm设置临时镜像:
npm --registry https://registry.npm.taobao.org install express
//
下面的方法 需要操作系统目录 这玩意 目的不纯。慎重使用,而且在我这里无效果,不建议使用。
首先 npm instal或者yarn install
执行 npm install electron-fix -g
接着 electron-fix start

npm config set electron_mirror https://cdn.npm.taobao.org/dist/electron/
单独安装electron
npm install electron -g

相关文章:

  • 2021-09-18
  • 2021-09-17
  • 2021-07-08
  • 2021-06-12
  • 2021-05-22
  • 2021-11-27
  • 2021-07-17
  • 2022-01-11
猜你喜欢
  • 2021-07-03
  • 2021-11-21
  • 2021-11-01
  • 2021-07-17
  • 2021-12-01
  • 2021-11-07
  • 2021-11-24
相关资源
相似解决方案