1. Address:http://nodejs.org/download/ after entering, download the corresponding installation package according to different operating system
2. Run after download.
You can enter node-v and npm-v at the command line
To see if the installation was successful
3.NPM (Node Package Manager) Install, update, uninstall package
(1) Global mode download, enter command line mode:
NPM install-g <package name>
After the installation is complete, you will be prompted about where the package is installed and other relevant information.
Can modify the storage path of NPM's global module and the path of the cache
On the command line, enter
npm config set prefix "f:\test" and npm config set cache "F:\node_cache"
Enter NPM config ls-l to view the current directory settings, which can be configured with the NPM Config Set property Name property value
(2) Local mode download, enter command line mode input:
NPM Install <package name>
The stored path is the current directory you entered
The install command can be
NPM Install <package name>@<version spec>
Select the version of the package that you installed, such as
NPM install [email protected]
NPM Install the latest version of [email protected] 0.2
npm Install [email protected]"<0.3" less than 0.3 of the latest version
npm install =0.1.0<0.3.1 ' >[email protected]">=0.1.0<0.3.1" , etc.
Uninstalling packages
NPM Uninstall <package name>
Update package
NPM Update <package name>
Global operations Join the-G flag