我正在进行一个演练,指导您在ubuntu机器上设置节点.我正处于配置系统以允许节点在端口80上运行的步骤.它(以及我看过的其他一些指南)建议运行以下命令:
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node
这将返回以下错误:
Failed to set capabilities on file `/usr/local/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
知道什么可能导致这个错误吗?
解决方法
为了避免此错误,您可以使用哪个节点解析非符号链接可执行文件,作为完整示例:
sudo apt-get install libcap2-bin sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
“which”命令显示shell命令的完整路径.