0x01 Dowload

Download nodejs from nodejs.org/en/


0x02 npm

NPM の role

  • Allows users to download third-party packages written by others from the NPM server for local use.
  • Allows users to download and install command line programs written by others from the NPM server for local use.
  • Allows users to upload their own packages or command-line programs to the NPM server for others to use

NPM common commands

npm <command> -h
npm -l
npm help <term>
npm help npm

npm -v
npm list
npm update [ --save-dev ]
npm update <pkg_name> [ -g ] [ --save-dev ]
npm uninstall <pkg_name> [ -g ] [ --save-dev ]
npm install <pkg_name> [ -g ] [ --save-dev ]
Copy the code

0 x03 NPM の mirror

CNPM の installation

npm install cnpm -g --registry=https://registry.npm.taobao.org
Copy the code

Change the address to use the mirror

  • The default address of NPM ishttps://registry.npmjs.org/
  • You can usenpm config get registryView the NPM warehouse address
  • You can usenpm config set registry https://registry.npm.taobao.orgTo change the default download address, to achieve the purpose of using Taobao image without installing CNPM, and then use the above get command to check whether it is successful

The NRM tool manages images

  • NRM package installation command:npm i nrm -g
  • NRM manages the available mirror source addresses and the mirror source addresses currently in use, but simply provides a few urls and allows us to switch easily between them
  • nrm ls or nrm list, view all available mirrors, and can be switched. * indicates the address currently used by NPM. You can use the commandnrm use taobao or nrm use npmTo switch between the two

END ヘ |, ∀, | ノ * ~ O