How to install Node.js Express

  
under Linux

Node.js is a new language in Linux, and Node.js express is some default template. Of course, there may be more than one template for express. This article will give two examples to introduce how to install Node.js Express under Linux.

First, install

all first installed by express-generator, or when you create a project, you are prompted to express command not found

npm install -g express- Generator #First need to install express-generator

npm install -g express

express -V #Verify if the installation is successful

Second, create project

$ Express myfirstexpress # express default template uses jade, if you need ejs template support, plus -e option, ie express -e myfirstexpress

$ cd myfirstexpress

$ ls

App.js bin package.json public routes views #Project directory structure

Third, run the project

$ npm install # Need to wait for a while, because you need to get a lot of library files

$ npm start

4. Access the first express project

Enter http://127.0.0.1:3000

in the browser. How is this in Linux? Introduction to the installation of Node.js Express, more installation of express templates, or with this above Both are similar, and users can make their own decisions.

Copyright © Windows knowledge All Rights Reserved