Ubuntu install nvm and install node steps

Install nvm:

   There is an easy way to install nvm:


$ wget -qO- https://raw.github.com/creationix/nvm/v0.25.0/install.sh | sh

This installation actually clones nvm into ~/.nvm. The scource added in ~/.bashrc and ~/.zshrc are both set up during the installation.

If your nvm version is a lower version, you can also checkout the new version installation in ~/.nvm/, and it will be updated automatically.

 

Install node:

After installing nvm, you can directly use nvm to install node;

First use nvm to view all existing node versions:

$ nvm ls-remote   

 Then select the version you want to install:

$ nvm install <version>

 If multiple versions are installed, you can use

nvm use <version>

to choose the version you want.

You can use nvm current to view the current node version, and node ls to view the local node.

Set the default version with the following command:

  $ nvm alias default<version>

 nvm installs npm when it installs npm.

After installation, you can check the version you have installed with node -v.

 

Install express:

   $ nom install -g express-generator

 For other express commands, see the express tutorial.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326530140&siteId=291194637