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
  • 相关阅读:
    1.5 判断是奇数还是偶数(比较运算符 & if...else)
    1.4计算器 (数字类型 & 算术运算符 &赋值运算符)
    1.3hello 张三(终端交互 & 字符串)
    1.2python语言环境 & python IDE(集成开发环境)搭建
    Centos 7 下安装jdk 7
    Centos 7 安装redis
    git 学习笔记
    git 基础操作
    git 获取远程分支的代码
    redis基础操作
  • 原文地址:https://www.cnblogs.com/rubekid/p/14748909.html
Copyright © 2011-2022 走看看