Last active
July 9, 2020 03:30
-
-
Save xialeistudio/4685b1e63c5c566debcb65411391fed0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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