Skip to content

Instantly share code, notes, and snippets.

@xialeistudio
Last active July 9, 2020 03:30
Show Gist options
  • Save xialeistudio/4685b1e63c5c566debcb65411391fed0 to your computer and use it in GitHub Desktop.
Save xialeistudio/4685b1e63c5c566debcb65411391fed0 to your computer and use it in GitHub Desktop.
#!/bin/bash
# input version
echo Please input NodeJs version to install:
read version
wget https://npm.taobao.org/mirrors/node/v${version}/node-v${version}-linux-x64.tar.gz
tar xzf node-v${version}-linux-x64.tar.gz
mv node-v${version}-linux-x64 /opt/node
echo 'export PATH=/opt/node/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
echo checking nodejs:
node -v
echo checking npm:
npm -v
# 设置镜像
npm config set registry=http://registry.npm.taobao.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment