Node.js: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
Line 6: Line 6:
* install Node.js using the "Node.js Version Manager" nvm [https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server details]
* install Node.js using the "Node.js Version Manager" nvm [https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server details]
** 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.32.1/install.sh | bash
* restart terminal (or...
* restart terminal (or...
  export NVM_DIR="/home/m/.nvm"
  export NVM_DIR="/home/m/.nvm"

Revision as of 01:48, 13 November 2016

Installation

Windows

Linux

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
  • the common .bashrc_env should take care of this: update .bashrc to configure node on even non-interactive shells - it should match the restart lines, above
  • 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