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
  • 相关阅读:
    动态库 DLL 封装二:dll封装方法
    动态库 DLL 封装一:dll分类
    C++读取配置文件ini
    WCHAR 字符串拼接
    关于web桌面应用的集成解决方案
    CSS Grid网格布局(转)
    使用 antd 的 form 组件来自定义提交的数据格式
    syslogd日志的一些作用
    我的三年感悟——避免无尽的自我内耗
    《被讨厌的勇气》读后感
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/14452517.html
Copyright © 2011-2022 走看看