ExpressJS - throw er Unhandled error event

前端 未结 30 1959
囚心锁ツ
囚心锁ツ 2020-12-12 09:30

I created expressjs application using the following commands:

express -e folderName
npm install ejs --save
npm install

When I run the appli

30条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 10:20

    If you've tried killing all node instances and other services listening on 3000 (the default used by the express skeleton setup) to no avail, you should check to make sure that your environment is not defining 'port' to be something unexpected. Otherwise, you'll likely get the same error. In the express skeleton's app.js file you'll notice line 15:

    app.set('port', process.env.PORT || 3000);
    

提交回复
热议问题