-
Notifications
You must be signed in to change notification settings - Fork 2k
Last alpine image breaks npm install with git+ssh #1378
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
Comments
I don't know what package you're trying to install - I'm assuming it is due to some pre-built binary not being available, so it attempts to build from source, which requires I don't think it's a bug in this image or in npm. I might be wrong though. You should take a look at the logfile after the failure. |
It looks like NPMv7 issue: |
It turns out that NPMv7 respects NPMv6: damian_koper@X:~/Desktop/npm-test $ docker run -it node:lts-alpine sh
/ # npm -v
6.14.8
/ # npm config ls -l | grep shell
script-shell = null
shell = "bash"
/ # apk add git
OK: 23 MiB in 22 packages
/ # npm i github:damiankoper/piw.git # random repo
# WORKS NPMv7: damian_koper@X:~/Desktop/npm-test $ docker run -it node:alpine sh
/ # npm -v
7.0.3
/ # npm config ls -l | grep shell
script-shell = null
shell = "bash"
/ # apk add git
OK: 23 MiB in 22 packages
/ # npm i github:damiankoper/piw.git # random repo
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path bash
npm ERR! errno -2
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent Solution for NPMv7: /app # npm config set shell sh # Should this be added to alpine Dockerfile with NPMv7?
validBefore? true
/ # npm i github:damiankoper/piw.git # random repo
WORKS |
so npm defaults to |
I had the same issue (installing package from git) and adding the following line in my Dockerfile fixes the issue. Thanks @damiankoper
Edit: answer to the next comment, yes v15.1.0 solve the issue ^^ |
Default shell was fixed in NPM and included in the 15.1.0 images |
It looks like NPMv7
npm install
wants to usebash
, which is not present in alpine image. NPMv6 works fine onlts-alpine
.DIGEST: sha256:97204ef250fa90f8177084ef6d7641ede6d48c4c8acfb30faf3580bee5c59c0b
Is it NPM problem or with some settings connected with latest image?
Log:
The text was updated successfully, but these errors were encountered: