Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian packages missing nodejs alternative #1262

Open
jasonaowen opened this issue Sep 20, 2021 · 3 comments
Open

Debian packages missing nodejs alternative #1262

jasonaowen opened this issue Sep 20, 2021 · 3 comments

Comments

@jasonaowen
Copy link

Previous versions of the Debian nodejs packages contained a postinst script which called update-alternatives to set up /usr/bin/nodejs, but recent versions no longer do this. As a result, scripts that depended on /usr/bin/nodejs being present no longer function on newly built machines, while they do still work on machines that upgraded nodejs package from a version with that script.

I've spot checked a few:

(I checked by downloading the .deb file, running ar x ${file} to extract it, extracting the control file with tar -xf control.tar.*, and examining postinst if present.)

This is closely related to #1095, which is asking about Ubuntu packages, but I'm not sure if packages for Debian are distinct.

As a workaround, users can manually run the command that used to be in postinst:

update-alternatives --quiet --install /usr/bin/nodejs nodejs \
    /usr/bin/node 50 \
    --slave /usr/share/man/man1/nodejs.1.gz nodejs.1.gz \
    /usr/share/man/man1/node.1.gz
@meramsey
Copy link

This is still an issue with later stuff like ubuntu jammy with 14.20.0-deb-1nodesource1.deb

Was a really odd issue till I found this old bug.

@borys-p
Copy link

borys-p commented Nov 14, 2022

Same thing just happened to us with nodejs_16.18.1-1nodesource1_amd64.deb

To me, that's a breaking change and shouldn't be included in a minor release.

@szepeviktor
Copy link

I've just added nodejs alternative to my install script.

if ! hash nodejs 2>/dev/null; then
    update-alternatives --install /usr/bin/nodejs nodejs /usr/bin/node 50
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants