Troubleshoot problems with running node. JS Express on Eclipse

Source: Internet
Author: User

I've been doing it since yesterday. Node. JS successfully installed Express node. JS Supervisor But there are a lot of problems with setting up Node Express project in Eclipse, looking at a lot of information on the Internet, big head, all kinds of patchwork has finally come out

1: Build Express project Choose Jade has been built unsuccessfully,

I don't know why, but if you don't choose the Jade template, you can build it.

2: Directly choose to establish node project, regardless of that express, built after the empty folder inside, do not care about him,

3: Use the cmd command line to transform node project into Express project, the following statement:

Find your Eclipse workspace address first, like mine in E:\2018-4-6

Command line, enter

E:

CD E:\2018-4-6

EXPRESS-E your node project name, online also said input express-e ejs node project name feel not much difference, finally is to establish EJS project

Show that the project is not established, enter Y

CD your node project name

NPM Install

NPM start

And then if the final show that the Express project has been deployed, of course, there are some people in this sentence will appear below the Port 3000 is occupied error, then you need to do is to find the process that occupies Port 3000 and stop, if not yet, simply in the task Manager shutdown all cmd command line process, Restart Eclipse, then reopen the command line, go directly to your node project address, and NPM start will do.

The command line's work is done and the eclipse operation begins

First you have to refresh the node project under Eclipse, and then you will find that it becomes the Express project you want, choose App.js execution is OK, as long as there is no error, I would like to add, because I use express 4 So App.js did not write what listening port is App.listen (3000) This sentence, in fact, you do not have to automatically add, because the 3000 port settings are already included in the project bin in the www file, anyway you do not have to worry about the line, because I have been groping this problem

Finally you enter on the browser localhost:3000 will find the page normal access, indicating that everything is successful,

However, after you have succeeded in eclipse to stop running the project is not enough, but also need to turn off the command line process, the direct input ctr+c will prompt you to stop the batch processing, you enter Y can be, if you do not stop the command line process, it seems that port 30,001 is directly occupied, When you run other Expres projects, there will be port occupancy.

Well, I have already mastered all of my words, but although the successful visit, but I still just stay in the stage of successful operation, specifically why do I still foggy, hope that after the actual combat more learning ....

Troubleshoot problems with running node. JS Express on Eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.