Wednesday, 15 July 2015

node.js - How do I install the newest unstable NodeJS (e.g. 0.11.xyz) on Ubuntu -



node.js - How do I install the newest unstable NodeJS (e.g. 0.11.xyz) on Ubuntu -

i'm looking playing around koa , need run newest unstable version of nodejs.

is there simple apt-get or npm or node phone call can create newest nodejs version?

you should install nvm, or node version manager, such n, has less github stars, released later, can installed npm: npm install -g n, , contains simpler api.

(below substitute nvm install n. other commands identical substitute nvm n.)

nvm has remote command line install script:

`curl https://raw.githubusercontent.com/creationix/nvm/v0.20.0/install.sh | bash`

or clone repo $ git clone creationix/nvm

then add together either $home/.zshrc, $home/.bashrc, or $home/.profile:

$ source path/to/.nvm/nvm.sh

with nvm installed, install needed node versions, , set aliases switch between versions.

for example:

$ nvm install 0.8 $ nvm install stable $ nvm install unstable $ nvm install 0.9.21 $ nvm alias work 0.9.21 $ nvm alias legacy 0.8

when leaving off patch number installs latest patch under version, keywords stable , unstable.

as of winter 2014 installs , creates alias to:

the latest v0.10.x stable. the latest v0.11.x unstable (even/odd digit versions === stable/unstable). the final release v0.8.x legacy. and specified version v0.9.21 work.

to switch between versions: nvm utilize alias

nvm utilize work switch 0.9.21 while nvm utilize stable switch latest local v0.10.x, , nvm complain if seek utilize version has not been downloaded.

to check if there more recent versions use: nvm ls-remote.

this lists available versions , highlights ones installed.

to see locally installed node versions: nvm ls

to uninstall nvm delete node related directories: ~/.nvm, ~/.npm, , ~/.bower standard $ rm -rf

there not lot of magic in either library.

nvm works installing each version of node under $home/.nvm/ , symlinks active version .nvm/bin directory, including command-line tools installed globally via npm -g, provided user's $path.

see nvm's usage section or n's usage section easy overview of rest of commands .

node.js npm

No comments:

Post a Comment