簡體   English   中英

錯誤:偵聽端口444/443時監聽EACCES 0.0.0.0:444 node.js

[英]Error: listen EACCES 0.0.0.0:444 node.js while listening on port 444/443

我正在使用node.js開發webrtc應用程序。當我運行命令'node server.js'時出現以下錯誤。

running on https://localhost:444
    events.js:160
          throw er; // Unhandled 'error' event
          ^

Error: listen EACCES 0.0.0.0:444
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1246:19)
    at listen (net.js:1295:10)`enter code here`
    at Server.listen (net.js:1391:5)
    at Object.<anonymous> (C:\Websites\WebRTC\server.js:16:63)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

我的server.js是

var fs = require('fs'),
    express = require('express'),
    https = require('https'),
    http = require('http');
var app = express();

app.use(express.static(__dirname));

http.createServer(app).listen(444);

console.log('running on https://localhost:444');

謝謝。

監聽低於1024的端口需要root訪問https://unix.stackexchange.com/questions/16564/why-are-the-first-1024-ports-restricted-to-the-root-user-only

只需在命令前加上sudo即可運行該應用

sudo node server.js

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM