make docs more readable

This commit is contained in:
AJ ONeal 2018-05-24 21:34:44 +00:00
부모 748c51a687
커밋 82e6ace060
1개의 변경된 파일39개의 추가작업 그리고 20개의 파일을 삭제

파일 보기

@ -35,6 +35,39 @@ wget -nv https://bit.ly/node-installer -O - ./node-installer.sh; bash ./node-ins
### Choosing a specific version
**Latest**
```bash
export NODEJS_VER=""
```
**Exact**
```bash
export NODEJS_VER="v10.2.1"
```
**Latest of vX.Y.Z**
```bash
export NODEJS_VER="v8.1"
```
**Latest of vX.YY.Z**
```bash
# latest of v8.11.x
export NODEJS_VER="v8.11"
```
**Latest of vX.Y**
```bash
export NODEJS_VER="v10"
```
Fun FYI, here's how the latest version is determined:
```bash
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"
@ -46,25 +79,6 @@ NODEJS_VER=$(curl -fsSL https://nodejs.org/dist/index.tab | tail -n +2 | cut -f
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
Just set BOTH `NODE_PATH` and `NPM_CONFIG_PREFIX`.
@ -74,10 +88,15 @@ The install path will be the preceding `lib/node_modules`
```bash
export NPM_CONFIG_PREFIX=/tmp/user/local
export NODE_PATH=/tmp/user/local/lib/node_modules
```
```bash
curl -fsSL https://bit.ly/node-installer -o ./node-installer.sh; bash ./node-installer.sh --dev-deps
```
# If you want to add the install location to your PATH
If you want to add the install location to your `PATH`:
```bash
PATH=$PATH:/tmp/user/local/bin
```