Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #240988

how to install node.js on debian (Docker) with 'apt-get' - having issues

From "/dev /local/ca" <devlocalca@gmail.com>
Newsgroups linux.debian.user
Subject how to install node.js on debian (Docker) with 'apt-get' - having issues
Date 2021-10-06 23:40 +0200
Message-ID <D5mNP-4M4-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

How would I get the latest version of node.js (16.x.x) installed on Debian
(in a Docker container)

Reference:

https://stackoverflow.com/questions/69446940/how-to-install-node-js-version-16-x-x-in-a-debian-based-image-dockerfile-why

---
Date: Tuesday October 5th, 2021

Node 10.x was released on 2018-04-24 (but that's the default version when
using apt-get)

I have needs to have both Python and Node.js installed in running
container. I can get the latest version of python in a container using:

FROM python:alpine

or

FROM python:buster <== Debian based

How do I get the latest version of node.js (16.10.0) installed on Debian
(in a Docker container)

Whe I do this:

FROM python:buster

RUN apt-get update && \
  apt-get install -y \
    nodejs npm

I get these versions of node:

node: 10.24.0

npm 5.8.0

and when run in the container give a long statement about no longer being
unsupported.

What's up with the package repo that 'apt-get' pulls from, that it will not
install later versions of node (14.x or greater)?

If I pull from:

FROM python:alpine

and include these lines
RUN apk -v --no-cache --update add \
    nodejs-current npm

I will get node 16.x version, which makes it easy. I don't have to do
anything else.

Is there something equivalent for python:buster (Debian based)

I would really like a one or two liner in my Dockerfile and not a pages of
instructions with a dozen commands to simply get node in the image.

I would appreciate any tested/proven reply. I am sure a number of others
have the same question. Other stackoverflow articles on this subject are
convoluted and do not provide the simple solution I am hoping to find that
is available with pytyon:alpine

There is a reason I need python:debian and cannot use python:alpine in this
one use case, otherwise I would chose the latter.

Is there a way some how to get a package repo maintainers attention to show
me how to get a recent version (14..16), into the apt-get repository?

It appears many people are having issues with this.

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

how to install node.js on debian (Docker) with 'apt-get' - having issues "/dev /local/ca" <devlocalca@gmail.com> - 2021-10-06 23:40 +0200
  Re: how to install node.js on debian (Docker) with 'apt-get' -  having issues Dan Ritter <dsr@randomstring.org> - 2021-10-07 00:10 +0200
  Re: how to install node.js on debian (Docker) with 'apt-get' -  having issues "Andrew M.A. Cater" <amacater@einval.com> - 2021-10-09 12:10 +0200

csiph-web