Node.js: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
* nvm ls-remote --lts | * nvm ls-remote --lts | ||
* nvm install --lts # to get the latest long-term-support release - you can pick a release too if needed, eg 5.8.0) | * nvm install --lts # to get the latest long-term-support release - you can pick a release too if needed, eg 5.8.0) | ||
* nvm alias default stable | * nvm ls # show what you have | ||
* the common .bashrc_env should take care of | * nvm alias default stable # needed? | ||
* the common .bashrc_env should take care of node setup | |||
* additional fyi goo | * additional fyi goo | ||
** nvm use 4.2.1; node -v; nvm ls; nvm alias default 0.11.13; nvm use default | ** nvm use 4.2.1; node -v; nvm ls; nvm alias default 0.11.13; nvm use default |
Revision as of 18:46, 1 September 2017
Installation
Windows
- Use the latest 64-bit installer
- Then you can just use it from a cmd prompt, eg: npm install -g rad-scripts
Linux
- install Node.js using the "Node.js Version Manager" nvm details
- find the latest nvm version
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
- restart terminal (or...
export NVM_DIR="/home/m/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
- nvm ls-remote --lts
- nvm install --lts # to get the latest long-term-support release - you can pick a release too if needed, eg 5.8.0)
- nvm ls # show what you have
- nvm alias default stable # needed?
- the common .bashrc_env should take care of node setup
- additional fyi goo
- nvm use 4.2.1; node -v; nvm ls; nvm alias default 0.11.13; nvm use default
- You can create an .nvmrc file containing version number in the project root directory and it will default to that version
- Global package install example: npm install -g rad-scripts
Upgrade
Don't mess with anything other than lts, you've been warned:
- nvm install --lts