zoukankan      html  css  js  c++  java
  • Electron 初始化

    mkdir my-electron-app && cd my-electron-app
    npm init -y
    npm i --save-dev electron

    npm install.js 报错

    > electron@12.0.7 postinstall D:javascriptplaybill
    ode_moduleselectron
    > node install.js
    
    RequestError: read ECONNRESET
        at ClientRequest.<anonymous> (D:javascriptplaybill
    ode_modulesgotsource
    equest-as-event-emitter.js:178:14)
        at Object.onceWrapper (events.js:421:26)
        at ClientRequest.emit (events.js:326:22)
        at ClientRequest.origin.emit (D:javascriptplaybill
    ode_modules@szmarczakhttp-timersourceindex.js:37:11)
        at TLSSocket.socketErrorListener (_http_client.js:469:9)
        at TLSSocket.emit (events.js:314:20)
        at emitErrorNT (internal/streams/destroy.js:100:8)
        at emitErrorCloseNT (internal/streams/destroy.js:68:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21)
    npm WARN playbill@1.0.0 No description
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! electron@12.0.7 postinstall: `node install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the electron@12.0.7 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:UsersAdministratorAppDataRoaming
    pm-cache\_logs2021-05-09T12_40_24_916Z-debug.log

    解决方案:

    npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

    DEMO

    https://github.com/electron/electron/tree/v12.0.6/docs/fiddles/quick-start
  • 相关阅读:
    使用 ES2015 编写 Gulp 构建
    ES6 Promise 接口
    Git 文件比较
    JavaScript 属性描述符
    Vim 插件之 NERDTree
    Raspberry Pi 3 Model B 安装 OSMC
    How ADB works
    [Linux] zip 与 unzip 命令
    在 Ubuntu 配置 PPTP Server
    [Linux] 查看系统启动时间
  • 原文地址:https://www.cnblogs.com/rubekid/p/14748909.html
Copyright © 2011-2022 走看看