节点 http 服务器错误

Node http-Server error

我正在学习本教程:https://www.youtube.com/watch?v=I1USsIW8aWE 至少 21:09 调用了一个 http 服务器。

我在 windows 盒子上安装了节点。我还使用 npm 安装了 http 服务器。

当我尝试 运行 服务器时出现此错误。

F:\Projects\LargeAppSpa\LargeAppSpa.FrontEnd
λ http-server src
C:\Users\Josh\AppData\Roaming\npm\node_modules\http-server\bin\http-server:51
if (err) throw err;
               ^
Error: listen EACCES
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1112:19)
at listen (net.js:1155:10)
at net.js:1253:9
at dns.js:85:18
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3

认为这是一个端口问题,我 运行 这看起来有效...

F:\Projects\LargeAppSpa\LargeAppSpa.FrontEnd
λ http-server src -p1234
Starting up http-server, serving src on: http://0.0.0.0:1234
Hit CTRL-C to stop the server

当我将浏览器导航到这个位置时,我得到一个 "page can not be displayed message"。

问题1)如何在没有端口的情况下使用http-server并使用默认的8080?

问题 2) 为什么这不起作用?我做错了什么?

谢谢!

通常,在 Windows 端口 80 可能与 IIS 服务器绑定。
尝试先停止 iis,然后 运行 再次尝试停止 iis。

Error: listen EACCES

基本上是说它无法访问该端口

也请post你的应用代码...