Many beginners who have just come into contact with Nodejs will experience a cumbersome environment installation process.
General to install NODEJS,NPM and express three kind of things. So what do these three things do separately?
This article outlines what these three things are all about:
Nodejs
The first thing to say is Nodejs, since we want to install NODEJS, that this actually there is no good explanation.
Nodejs is the run framework, just like C # and. Net,java and JRE, Nodejs is Nodejs.
So actually installed Nodejs after, Nodejs actually already can encode and run.
Npm
NPM is a JavaScript package management program.
Its purpose and maven in. NET Nuget,java are the same.
Students who do not know about NuGet and Maven can continue to look down:
What is package management?
When we develop our programs, we often choose third-party frameworks to help us focus on our business.
So once you choose a third-party framework, there are certain issues:
Where do I go to download the third-party framework I want?
What version do I want to use?
How do I update a third-party framework I already use?
Then the package manager is to solve the above problems and exist.
After the user installs the guarantee manager, just tell the package manager what frame I want to use, what version of the. The rest of it, the package Manager is all done for you, to help you download the specified version of the framework to the project you need and reference, and even participate in the compilation and running.
NPM is a program that provides downloads for the various common third-party frameworks that we need for JavaScript development.
Express
Often see NODEJS environment installation involves express installation, this thing is also very difficult to install, often there will be a variety of problems.
So what does Express do?
Nodejs have some knowledge of the classmate must know, Nodejs itself in fact only provides files, network port monitoring, character sets and other basic operations.
But what seems to be missing if we're going to go to a mature BS architecture server? such as routing functions, exception handling and so on.
If we were to do the project every time we had to write some of the basic skeleton required by the BS Architecture Server, we would certainly not be happy.
Then Express will help you accomplish these things.
Express is a set of frameworks for Nodejs.
Yes, it's just a frame, not the nodejs, and we can do nodejs without it, just--will be tired ...
Express provides a lot of content for the service-side skeleton, so we can write the code that belongs to the business logic as much as possible, reduce the difficulty of error handling and so on.
Express is made up of two parts in a newer version:
Express
Express-generator
The former is the framework responsible for the runtime.
The latter is the standard directory structure responsible for generating an express project, and the express framework can run smoothly as long as the corresponding files are stored in the appropriate directory.
Article for the author original, reproduced please indicate the source HTTP://WWW.ZIZHUSOFT.COM/NOTE/SHOW.ASPX?ID=B67B2069-4C15-4008-B0F3-6CDC7BE3F2A1, thank you for your cooperation
"Reprint" nodejs,npm,express respectively what?