zoukankan      html  css  js  c++  java
  • node.js 基本使用

    执行 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"

    执行 目录下某个 JS

    $ 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

  • 相关阅读:
    JavaWeb——Servlet开发3
    8.3.3
    8.3.2
    8.3
    8.2
    8.1
    7.3.9
    7.3.8.3
    7.3.8.2
    7.3.8.1
  • 原文地址:https://www.cnblogs.com/marklove/p/15207995.html
Copyright © 2011-2022 走看看