zoukankan      html  css  js  c++  java
  • 1、Electron 开发环境的安装

    1、安装nodejs

    node --version #查看node的版本

    如果没有安装就是百度或(待续一篇安装)

    npm config ls   #查看node安装及配置路径

    显示如下:

    C:Usersxrl>npm config ls
    ; cli configs
    metrics-registry = "https://registry.npmjs.org/"
    scope = ""
    user-agent = "npm/6.12.1 node/v12.13.1 win32 x64"
    
    ; userconfig C:Usersxrl.npmrc
    cache = "D:\SoftWare\nodejs\node_cache"
    prefix = "D:\SoftWare\nodejs\node_global"
    
    ; builtin config undefined
    
    ; node bin location = D:SoftWare
    odejs
    ode.exe
    ; cwd = C:Usersxrl
    ; HOME = C:Usersxrl
    ; "npm config ls -l" to show all defaults.
    View Code

    为了保留C盘的剩余空间,有必要,把 npm的 global 路径修改到其他盘符下

    npm config set cache "D:SoftWare
    odejs
    ode_cache"
    npm config set prefix "D:SoftWare
    odejs
    ode_global"

    2、安装Electron

    npm install -g cnpm -registry=https://registry.npm.taobao.org #安装cnpm
    View Code

     注意:安装后把cnpm文件夹设置环境变量

    npm install electron -g #安装  或 cnpm install electron -g #如果没有安装 cnpm须安装一下
    electron -v #查看electron版本,查看是否安装
    npm update electron -g #更新electron版本

    安装成功能如下:

    C:WINDOWSsystem32>electron -v
    
    C:WINDOWSsystem32>"node"  "D:SoftWare
    odejs
    ode_global\node_moduleselectroncli.js" -v
    
    v11.3.0
    View Code

    通过直接运行:electron 应该能出现一个界面说明对了

    御载:

    npm uninstall electron #御载

    问题1:

    没有试过记录一下:https://www.kanzhun.com/jiaocheng/387797.html

    error Command "electron-serve" not found. Did you mean "electron:serve"?

    npm install electron-serve -g

    下一篇:2、Electron Hello Word!

    node
  • 相关阅读:
    JVM内存问题分析
    CAS
    普通内部类,匿名内部类和静态内部类
    文章简介
    conda更换下载源
    MySQL常见约束
    MySQL常见的数据类型
    DDL(数据定义语言)
    DML语言(数据操纵语言)
    进阶9:联合查询
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/14452517.html
Copyright © 2011-2022 走看看