show selecting version in docs

This commit is contained in:
AJ ONeal 2018-05-24 21:31:04 +00:00
parent 0c7d0a7da6
commit 748c51a687
1 changed files with 25 additions and 5 deletions

View File

@ -36,13 +36,33 @@ wget -nv https://bit.ly/node-installer -O - ./node-installer.sh; bash ./node-ins
### Choosing a specific version ### Choosing a specific version
```bash ```bash
echo "Current node.js version is $(curl -fsSL https://nodejs.org/dist/index.tab | head -2 | tail -1 | cut -f 1)" NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f 1 | head -1 )
echo "The current node.js version is $NODEJS_VER"
``` ```
```bash ```bash
# To install a specific version rather than defaulting to latest BASE_VER="v10\\."
# latest version at time of writing are v8.11.1 and v10.1.0 NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f 1 | grep $BASE_VER | head -1 )
export NODEJS_VER="v10.1.0" echo "Latest node.js $BASE_VER is $NODEJS_VER"
```
To install the latest of a specific version rather than defaulting to latest
```bash
### latest version
export NODEJS_VER=""
# exact version
export NODEJS_VER="v10.2.1"
# latest of v8.1.x
export NODEJS_VER="v8.1"
# latest of v8.11.x
export NODEJS_VER="v8.11"
# latest of v10.x
export NODEJS_VER="v10"
``` ```
### Choosing an install location ### Choosing an install location
@ -101,7 +121,7 @@ wget -nv https://bit.ly/node-installer -O /tmp/node-installer.sh; bash /tmp/node
### Other things you should know ### Other things you should know
This is what gets installed: This is what gets installed with the dev dependencies:
* rsync * rsync
* curl * curl