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
  • 相关阅读:
    MySQL------索引
    分组数据
    聚集函数
    Web的Java开发基础分享——学生信息管理系统(二)
    Web的Java开发基础分享——学生信息管理系统(一)
    shiny酷酷的第一篇CSDN博客
    vue2.0.js
    vue1.0.js的初步学习
    layui新手使用
    前端兼容性的一些问题
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/14452517.html
Copyright © 2011-2022 走看看