Skip to content

Commit 247ed8a

Browse files
jeremygauljharb
authored andcommitted
[readme] fix --no-use example
1 parent 14507f8 commit 247ed8a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
121121

122122
- If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
123123

124-
- You can add `--no-use` to the end of the above script (...`nvm.sh --no-use`) to postpone using `nvm` until you manually [`use`](#usage) it.
124+
- You can add `--no-use` to the end of the above script to postpone using `nvm` until you manually [`use`](#usage) it:
125+
126+
```sh
127+
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
128+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use # This loads nvm, without auto-using the default version
129+
```
125130

126131
- You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.
127132
Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not contain a trailing slash.

0 commit comments

Comments
 (0)