【问题标题】:Linuxbrew Nodejs - Bind to port 80Linuxbrew Nodejs - 绑定到端口 80
【发布时间】:2015-12-23 17:03:56
【问题描述】:

我想解决this issue中描述的相同问题。

因此我想执行以下命令:

$ sudo setcap cap_net_bind_service=+ep /home/username/.linuxbrew/bin/node 

这产生了错误:

Failed to set capabilities on file `/home/username/.linuxbrew/bin/node' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

是否会因为文件夹名称为 .linuxbrew 而发生这种情况,如果是,我该如何解决?

【问题讨论】:

  • 你检查过它的符号链接吗?

标签: node.js port linuxbrew


【解决方案1】:

这是因为您试图在符号链接上运行它。尝试运行它:

sudo setcap cap_net_bind_service=+ep $(readlink -f ~username/.linuxbrew/node)

【讨论】:

  • 是的,你是对的。我太愚蠢了,无法识别 /home/username/.linuxbrew/bin/node 是一个符号链接。感谢您的帮助。