prebuild / docker-images

Docker images for cross compiling prebuilt binaries for Node.js native addons.
GNU General Public License v3.0
10 stars 7 forks source link

Package source for nodejs is incorrect #17

Closed vweevers closed 3 years ago

vweevers commented 3 years ago

In the linux-armv6, linux-armv7, linux-arm64, android-armv7 and android-arm64 images, we're installing the nodejs package from the wrong source (debian rather than nodesource).

As can be seen in the docker build output of linux-armv6 for example:

...
Setting up nodejs (12.21.0~dfsg-5) ...

Confirmed by running:

> apt-cache policy nodejs
nodejs:
  Installed: (none)
  Candidate: 12.21.0~dfsg-5
  Version table:
     12.21.0~dfsg-5 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages
     10.24.1-1nodesource1 500
        500 https://deb.nodesource.com/node_10.x buster/main amd64 Packages

Because of this, npm isn't installed because only the nodesource package contains npm. This breaks prebuildify-cross which relies on npx.

Can be solved by doing:

echo Package: nodejs >> /etc/apt/preferences.d/preferences
echo Pin: origin deb.nodesource.com >> /etc/apt/preferences.d/preferences
echo Pin-Priority: 1000 >> /etc/apt/preferences.d/preferences

In addition, as you may notice in the output above, we're targeting the wrong debian version (in at least linux-armv6). Should be bullseye instead of buster.