distributions: [ERROR] Node.js 20 on Ubuntu22.04 Installation fail

Describe your bug

1.334 Err:1 https://deb.nodesource.com/node_20.x lunar/main arm64 nodejs arm64 20.5.1-deb-1nodesource1
1.334   404  Not Found [IP: 104.22.5.26 443]
…
88.27 E: Failed to fetch https://deb.nodesource.com/node_20.x/pool/main/n/nodejs/nodejs_20.5.1-deb-1nodesource1_arm64.deb  404  Not Found [IP: 104.22.5.26 443]
88.27 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Distribution Information:

  • OS: Ubuntu
  • Version jammy (22.04)

Node Version:

  • Node: Node.js v20.x

To Reproduce Steps to reproduce the behavior:

  1. Download https://deb.nodesource.com/gpgkey/nodesource.gpg.key to nodesource.gpg.key
  2. Build the following Dockerfile via: docker build .
    FROM ubuntu:lunar
    COPY nodesource.gpg.key .
    
    ENV DEBIAN_FRONTEND=noninteractive
    RUN apt-get update
    RUN apt-get install --yes \
            gpg \
            software-properties-common
    
    RUN gpg --dearmor --output /etc/apt/trusted.gpg.d/nodesource.gpg nodesource.gpg.key && \
        add-apt-repository --uri https://deb.nodesource.com/node_20.x
    
    RUN apt-get install --yes nodejs
    

Expected behavior

Node 20.x should be installed.

Screenshots

> [6/6] RUN apt-get install --yes nodejs:
0.926 Reading state information...
1.042 The following NEW packages will be installed:
1.042   nodejs
1.422 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1.422 Need to get 29.4 MB of archives.
1.422 After this operation, 193 MB of additional disk space will be used.
1.422 Err:1 https://deb.nodesource.com/node_20.x lunar/main arm64 nodejs arm64 20.5.1-deb-1nodesource1
1.422   404  Not Found [IP: 104.22.5.26 443]
1.437 E: Failed to fetch https://deb.nodesource.com/node_20.x/pool/main/n/nodejs/nodejs_20.5.1-deb-1nodesource1_arm64.deb  404  Not Found [IP: 104.22.5.26 443]
1.437 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
Dockerfile.test:13
--------------------
  11 |         add-apt-repository --uri https://deb.nodesource.com/node_20.x
  12 |     
  13 | >>> RUN apt-get install --yes nodejs
  14 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install --yes nodejs" did not complete successfully: exit code: 100

Additional context I needed to use the package repository key as documented in #1682.

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 18
  • Comments: 19

Most upvoted comments

Getting the same issue for Node 18.

#7 111.4 Err:1 https://deb.nodesource.com/node_18.x focal/main amd64 nodejs amd64 18.17.1-deb-1nodesource1
#7 111.4   404  Not Found [IP: 104.22.4.26 443]
#7 111.4 E: Failed to fetch https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.17.1-deb-1nodesource1_amd64.deb  404  Not Found [IP: 104.22.4.26 443]
#7 111.4 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The same error was happening to me, it worked for me to install nodejs in the new way that they ask for in the documentation: https://github.com/nodesource/distributions

But my version in this case is 18.

RUN set -uex; \
     apt-get update; \
     apt-get install -y ca-certificates curl gnupg; \
     mkdir -p /etc/apt/keyrings; \
     curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
      | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
     NODE_MAJOR=18; \
     echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
      > /etc/apt/sources.list.d/nodesource.list; \
     apt-get -qy update; \
     apt-get -qy install nodejs;

I have same issue too

E: Failed to fetch https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.17.1-deb-1nodesource1_amd64.deb  404  Not Found [IP: 104.22.4.26 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Plz quick fix it 😦(

Installing it according to instructions from deb.nodesource.com using the nodistro codename instead of a specific Debian/Ubuntu codename indeed helped to solve the issue. Thanks @soren121!

Also note, that they deprecated the old installation scripts (as it’s mentioned in the readme).

Install the repository using the nodistro codename instead of a specific Debian/Ubuntu codename.

I’m not sure if it’s intentional or an accident, but all of the package files were renamed. They’ve only updated thenodistro pool as of now, and not the distro-named pools.

seems to be working fine for me now out of no where

we solve it on our project with (for now) replacing current version of node to stable one (.gitlab-ci.yaml)

Screenshot_20231101_123114

Workaround for those affected:

curl https://deb.rwx.work/nodejs/node_20.x/pool/main/n/nodejs/nodejs_20.5.1-deb-1nodesource1_amd64.deb -o nodejs_20.5.1-deb-1nodesource1_amd64.deb
dpkg -i nodejs_20.5.1-deb-1nodesource1_amd64.deb

I recommend, as we are, you download this to your own S3 bucket or web server. If rwx.work notices or gets overloaded it too may stop working.

You may also need apt-get update ; apt-get -y install gnupg python3-minimal before the dpkg in some slim images.