错误:在侦听端口444/443时侦听EACCES 0.0.0.0:444 node.js

Ami*_*ant 1 javascript node.js webrtc

我正在使用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)
Run Code Online (Sandbox Code Playgroud)

而我的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');
Run Code Online (Sandbox Code Playgroud)

谢谢.

woo*_*ieb 7

收听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
Run Code Online (Sandbox Code Playgroud)