tôi tạo ra và khởi động một ứng dụng như thế này:Node.js + Express: Ứng dụng sẽ không bắt đầu lắng nghe trên cổng 80
express -s -t ejs
npm install express
npm install ejs
node app.js
và nó hoạt động (trên cổng 3000). Nhưng khi tôi đi và thay đổi cổng đến 80, sau đó chạy node app.js
đầu ra này:
node.js:198
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'getsockname' of null
at HTTPServer.address (net.js:746:23)
at Object.<anonymous> (/var/www/thorous/app.js:35:67)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.<anonymous> (module.js:470:10)
at EventEmitter._tickCallback (node.js:190:26)
này hoạt động quá trên máy tính xách tay của tôi, nhưng không phải trên dụ Amazon EC2 của tôi, nơi cổng 80 đang mở. Có thể tìm ra điều gì sai. Có lời khuyên nào không?
Đó là một thông báo lỗi khủng khiếp. –