Electron踩坑笔记

首先,注意配置环境变量

依赖Python 2.7.15以上环境,请提前安装并配置环境变量。

C:\Users\[user-name]\AppData\Roaming\npm,这个目录是npm i pkg-name -g之后,可单独执行文件的默认目录。

npm i -g electron electron-builder

这个必选的,要不没法玩。

npm i -g windows-build-tools

这个也要装,打包用的。记得以管理员身份运行。

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Python 2.7.15 is already installed, not installing again.

Now configuring the Visual Studio Build Tools..

All done!

+ windows-build-tools@5.2.2

Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (72)

解决办法:node-sass,https://github.com/sass/node-sass/releases/tag/v4.11.0

set SASS_BINARY_PATH=C:\Stock\win32-x64-67_binding.node
npm install node-sass

could not use PowerShell to find Visual Studio 2017 or newer

npm install -g node-gyp

’vue-cli-service’ 不是内部或者外部命令,也不是可运行的程序

删除node_modules目录,删除package-locl.json重新执行install。

’electron-builder’ 不是内部或外部命令,也不是可运行的程序

配置环境变量:%USERPROFILE%\AppData\Roaming\npm

Quick Start

https://github.com/electron/electron-quick-start

# Clone this repository
git clone https://github.com/electron/electron-quick-start

# Go into the repository
cd electron-quick-start

# Install dependencies
npm install

# Run the app
npm start
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值