nvm是node版本管理工具
brew install nvm
安裝后
vim .bash_profile
添加:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
然后source .bash_profile
可查看nvm版本
nvm install xxx
下載你想要的版本
這里下載默認(rèn)路徑是國外的,速度慢。要替換鏡像
vi ~/.zshrc
添加:
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
使環(huán)境生效姚炕,source 一下
然后nvm install 版本就可以下載指定版本node
npm設(shè)置鏡像:一個(gè)為淘寶鏡像假瞬,一個(gè)為原始鏡像
npm config set registry http://registry.npm.taobao.org
npm config set registry https://registry.npmjs.org/
安裝electron
先安裝cnpm, 然后npm下載
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install -g electron
VSCode打開html, open in browser
installed
option+b