Node.js: Difference between revisions
(Created page with "=== Installation === '''Windows''' * Use the [https://nodejs.org/en/download/ latest 64-bit installer] * Then you can just use it from a cmd prompt, eg: npm install -g rad-scr...") |
No edit summary |
||
Line 7: | Line 7: | ||
** find the [https://github.com/creationix/nvm/releases latest nvm version] | ** find the [https://github.com/creationix/nvm/releases latest nvm version] | ||
** curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash | ** curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/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 | * nvm ls-remote | ||
* nvm install node # to get the latest release (stable by default) - you can pick a release too if needed, eg 5.8.0) | * nvm install node # to get the latest release (stable by default) - you can pick a release too if needed, eg 5.8.0) |
Revision as of 21:01, 25 September 2016
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.29.0/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
- nvm install node # to get the latest release (stable by default) - you can pick a release too if needed, eg 5.8.0)
- nvm alias default stable
- (update .bashrc to configure node on even non-interactive shells - see another for example)
- also: nvm use 4.2.1; node -v; nvm ls; nvm alias default 0.11.13; nvm use default
- also: You can create an .nvmrc file containing version number in the project root directory and it will default to that version
- example: npm install -g rad-scripts # to set the package manager to use a globally shared location