distributions: [ERROR] Node.js 16.x on Debian Bookworm Installation fail
Before we come to the bug, thank you very much for this project!
Describe your bug
Installing NodeJS 16 on Debian Bookworm gives npm: command not found
.
Distribution Information:
- OS: Debian
- Version: Bookworm
- Docker image:
debian:bookworm-20230703
Node Version:
- Node: v16.x
To Reproduce Steps to reproduce the behavior:
- Install Debian Bookworm:
docker run -ti --rm debian:bookworm-20230703 /bin/bash
- Install Node.js v16.x using following instructions:
apt-get update && \
apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs && \
npm update
Expected behavior
npm
is correctly installed. Instead
Screenshots If applicable, add screenshots to help explain your problem.
Additional context
Same works on debian:bullseye
.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 15 (3 by maintainers)
Commits related to this issue
- chore(release): Fix npm installation 🐛 Workaround here: https://github.com/nodesource/distributions/issues/1601 — committed to gremo/symfony-sail by gremo 5 months ago
- fix: use latest NodeSource installation script because with the previous method, we were getting the following error: ```console > [web production 13/17] RUN npm install -D mjml@"^4.14.1": 0.088 /b... — committed to engineervix/cookiecutter-wagtail-vix by engineervix 5 months ago
@lightswitch05
This seems to be the same issue as before. You have to pin
deb.nodesource.com
first. Just an example:This issue is resolved with our new repository. More information can be found here.
I had the same issue with node_20
it was indeed fixed with
This only works with app resources.
Could you also add this update the setup files like
https://deb.nodesource.com/setup_20.x
because it’s now installing a different version ?In my case it was installing version 18 instead of 20
Hello @JesusPaz @o1y - using the new repository does not fix this issue. Also, it is trivial to reproduce with a simple copy/paste command:
Node appears to install correctly - using the commands specificed by the new repository. However, the final
npm install
command fails with the same error this issue was opened with:Its also interesting that the same error occurs with node 18. Also using debian bullseye. It just seems NPM is never installed using this method. Is that the expectation?
@JesusPaz Any updates?
Actually, I would like to update my comment about bullseye - maybe something was going on with cache - but this works successfully with bullseye.
The exact same commend with bullseye switched out to bookworm fails:
We will check it out and let you know if we have any news.
Same here !
Our dockerfile looks like (NODE_VERSION=16):
and we get the same error: “npm not found”
As we work with php 8,1 we changed the node version to 18.x and it works.