nvm, nrm install, use

nrm

The full name of nrm is npm registry manager, which is the image source management tool of npm. Sometimes foreign resources are too slow, so we can use this to switch image sources.

npm install -g nrm

The most commonly used commands of nrm are: 

1. nrm ls to view existing sources 

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
  nj ----- https://registry.nodejitsu.com/
  rednpm - http://registry.mirror.cqupt.edu.cn/
  npmMirror  https://skimdb.npmjs.com/registry/
  edunpm - http://registry.enpmjs.org/

2.nrm add <source name> <source address> add a new source  

3.nrm use <source name> to switch to an existing source

      nrm use taobao

                         verb config Skipping project config: /home/ooxx/.npmrc. (matches userconfig)

   Registry has been set to: https://registry.npm.taobao.org/

4. nrm test speed measurement

  npm ---- 663ms
  cnpm --- 317ms
* taobao - 342ms
  nj ----- Fetch Error
  rednpm - Fetch Error
  npmMirror  1195ms
  edunpm - Fetch Error

 

nvm

The full name of nvm is Node Version Manager, which is the Nodejs version manager, which allows us to easily switch the version of Nodejs.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

source ~/.bashrc 

Common commands are:

nvm install stable installs the latest stable version of node

nvm install   installs the specified version, which can be installed vaguely, such as: install v6.2.0, nvm install 6.2.0

nvm uninstall   deletes the installed specified version, the syntax is similar to install

nvm use   switch to use the specified version node

nvm ls  to list all installed versions

nvm ls-remote  lists all remote server versions (official node version list)

nvm current   shows the current version

nvm alias  to add aliases to different version numbers

nvm unalias  remove defined alias

nvm reinstall-packages Reinstalls the npm package of the specified version number globally in the current version of the node environment

 

 

Guess you like

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