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 is
https://registry.npmjs.org/
- You can use
npm config get registry
View the NPM warehouse address - You can use
npm config set registry https://registry.npm.taobao.org
To 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
ornrm list
, view all available mirrors, and can be switched. * indicates the address currently used by NPM. You can use the commandnrm use taobao
ornrm use npm
To switch between the two
END ヘ |, ∀, | ノ * ~ O