02月04, 2018

electron安装

问题

Electron安装时碰到了一个问题, node install没有反应。

参考

  1. 在 electron-download文档https://github.com/electron-userland/electron-download可看到

    You can set the ELECTRON_MIRROR or NPM_CONFIG_ELECTRON_MIRROR environment variable or mirror opt variable to use a custom base URL for grabbing Electron zips. The same pattern applies to ELECTRON_CUSTOM_DIR and ELECTRON_CUSTOM_FILENAME:

解决方案

使用cnpm安装。

alias cnpm="npm --registry=https://registry.npm.taobao.org \
--ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron\
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
cnpm install && npm start

本文链接:http://fengbaiyang.cn/post/electron-install.html

-- EOF --

Comments

暂不支持评论,如有问题,请发邮件至baiyang.feng@outlook.com。 望不吝赐教~