Mac/Linux:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR=“KaTeX parse error: Expected 'EOF', got '&' at position 12: HOME/.nvm" &̲& ( git clone…NVM_DIR”
cd “$NVM_DIR”
git checkout git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)
) && . “$NVM_DIR/nvm.sh”
Windows: https://github.com/coreybutler/nvm-windows/releases
Node.js/NPM安装:
安装Node.js: nvm install 12.14.0
切换Node.js版本:nvm use 12.14.0
验证:npm -v
验证: node -v
// mac 在 .bashrc 或者 .zshrc 加入
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
// Windows 在 %userprofile%\AppData\Roaming\nvm\setting.txt 加入
node_mirror: https://npm.taobao.org/mirrors/node/ npm_mirror: https://npm.taobao.org/mirrors/npm/
Electron安装:
npm install electron --save-dev
npm install --arch=ia32 --plarform=win32 electron
验证安装成功:
npx electron -v
./node_modules/.bin/electron -v
加速技巧:
ELECTRON_MIRROR=https://cdn.npm.taobao.org/dist/electron npm install electron --save-dev