I'm trying to install Node on a Debian Docker container (specifically based off the nginx image). I checked for the correct install script to get version 6.x from nodesource but the curl part of the process errors out once it gets to adding the signing key to the key ring. I'm not particularly experienced with this level of server setup, and searching around for my error somehow didn't give me any good leads.

After apt-get update and upgrade, and installing sudo and curl, I'm trying to execute this:

sudo curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

and eventually always hit this:

## 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

Which of these programs are the preferred version? I am assuming these are upgrades or variants of the same thing. I don't recall running into this error on other systems when attempting to install node this way. Would a different version of Debian have one of the gnupg's installed in an acceptable manner?

1 Answer 1


I had the same problem. Add gnupg to apt install and it was ok:

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
  • 3
    See, how wonderful formatting options our editor has :-)
    – peterh
    Nov 23, 2017 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .