2019-02-13 01:15:32 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-02-12 23:55:17 +08:00
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
|
|
|
|
|
|
if [ -z $NODEJS_VERSION ]; then
|
|
|
|
NODEJS_VERSION="10"
|
2019-02-13 01:34:25 +08:00
|
|
|
NODEJS_VERSION_OPTIONS="--lts"
|
2019-02-12 23:55:17 +08:00
|
|
|
fi
|
|
|
|
|
2019-02-13 01:34:25 +08:00
|
|
|
nvm install $NODEJS_VERSION $NODEJS_VERSION_OPTIONS
|
2019-02-12 23:55:17 +08:00
|
|
|
nvm alias default $NODEJS_VERSION
|
|
|
|
nvm use default
|