我正在尝试在 Debian Docker 容器上安装 Node(特别是基于 nginx 映像)。我检查了正确的安装脚本以从 nodesource 获取 6.x 版,但是一旦将签名密钥添加到密钥环,过程的 curl 部分就会出错。我对这种级别的服务器设置并不是特别有经验,并且以某种方式搜索我的错误并没有给我任何好的线索。
在 apt-get 更新和升级,并安装 sudo 和 curl 之后,我正在尝试执行以下操作:
sudo curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
Run Code Online (Sandbox Code Playgroud)
并最终总是打这个:
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
(23) Failed writing body
Error executing command, exiting
Run Code Online (Sandbox Code Playgroud)
这些程序中哪些是首选版本?我假设这些是同一事物的升级或变体。我不记得在尝试以这种方式安装节点时在其他系统上遇到过这个错误。不同版本的 Debian 会gnupg
以可接受的方式安装 's 之一吗?
小智 7
我有同样的问题。添加gnupg
到 apt install 就可以了:
RUN apt install -y curl software-properties-common gnupg
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt install -y nodejs
RUN apt install -y build-essential libssl-dev
RUN node -v
RUN npm -v
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3925 次 |
最近记录: |