nodesource / nodesource/distributions

Debian packages missing nodejs alternative

Open
#1,262 3 comments 2 reactions 1 assignee View on GitHub

@JesusPaz is already working on this.

Since Feb 9, 2022.

Type: Bug waiting on response from NodeSource
Dominant language
Shell
Stars
13.8k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.