Reprinted from Https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000/ 00143450141843488beddae2a1044cab5acb5125baf0882000
Install node. js
Currently, the latest version of node. JS is 7.6.x. First, download the corresponding platform installer from the node. JS website
Be sure to select all components when installing on Windows, including Add to Path
tick.
After the installation is complete, in the Windows environment, open a command prompt, node -v
and then enter, if the installation is v7.6.0
OK, you should see such output:
C:\users\ieuser>node-vv7. 6.0
To exit the node. JS environment, double-click CTRL + C two times.
Npm
Before we formally start the node. JS study, let's meet NPM first.
What is NPM? NPM is actually a package manager for node. js.
Why do we need a package management tool? Because we developed it on node. js, we used a lot of JavaScript code written by someone else. If we want to use someone else to write a package, each time according to the name of the official website search, download code, decompression, re-use, very cumbersome. So a centralized management of the tool came into being: we all put their own modules into the development of the NPM online, if you want to use, directly through the NPM installation can be directly used, no tube code exists where, should be downloaded from.
More importantly, if we want to use module A, and module A is dependent on module B, module B also relies on module X and module y,npm to download and manage all dependent packages based on dependencies. Otherwise, by our own manual management, must be both troublesome and error prone.
With so much to say, where is NPM?
In fact, NPM has been installed in the node. js in passing. We should see similar output at the command prompt or terminal input npm -v
:
C:\>NPM-v4.1. 2
Installing node. js and NPM