简体   繁体   中英

Express not listening on localhost:3000

So, we've built a basic express node website

express -c手写笔express_example

Trying to run the app with DEBUG=express_example:* npm start

DEBUG = express_example:* npm开始

With node DEBUG=express_example:* npm start

Also, tried inside node runtime:

DEBUG = express_example:* npm在节点内部开始

http://localhost:3000/ is not connecting

在此处输入图片说明

Where are we wrong?

You need to create a variable called DEBUG with set command. There is not command like DEBUG , it is a name of variable, so please try to run your server with set (to create variable):

set DEBUG=express_example:* & npm start

Try

DEBUG='express_example:*' npm start

Your environment variable was not getting set properly. Note that you can have many different environment variables this way

TEST=foo DEBUG='bar' npm start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM