node.js and npm / cnpm / nrm installation

node.js and npm / cnpm / nrm installation

  • Installation node.js. Go to the official website to download, download LTS version. All the way to determine the point of installation, do not change any settings.
  • In git-bash or the cmd, enter node -v, view the version node, the node check whether the installation was successful. Then enter npm -vto view the version of npm. node.js built npm.
  • Go to Taobao mirror NPM official website , copy the sentence in the column "Description"
1
asl install -g cnpm --registry = https: //registry.npm.taobao.org

Run the command line. After cnpm can be used instead of npm to install the package.

  • cnpm use
1
2
3
cnpm install [name] // cnpm mounting module

cnpm sync connect // cnpm synchronization module, the command line only cnpm have this feature
1
2
3
4
5
6
7
8
9
npm install -g nrm 
or mounting CNPM
CNPM the install -g NRM

nrm -V // View nrm version
nrm ls // display all the available mirror source
nrm us a large column  installation node.js and npm / cnpm / nrm the e taobao // switch registry to taobao use Taobao mirror source
nrm use cnpm / / switch registry to cnpm i.e., source switching mirror
velocity nrm test // test all image sources

Node.js upgrade in windows

  • To the official website to download the new version of the .msi installer
  • After the download is complete, double-click the installer, install
  • Installation directory on your computer to the original installation directory node.js the same, such as node.js original installation directory is "C: Program Files (x86) nodejs", when you install the new version, the installation directory should be "C: Program Files (x86) nodejs "
  • After the installation is complete, view node.js and npm version
1
2
node -v
npm -v

Upgrade npm

1
-g install altitude above sea level

Another package management tools

Reference links

Guess you like

Origin www.cnblogs.com/lijianming180/p/12026685.html