my docker
- FROM node:9.11.2-alpine
- RUN apk add yarn
And error:
yarn (missing): required by: world[yarn]
[91mWARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
The command '/bin/sh -c apk add yarn' returned a non-zero code: 1
[Sat Jun 23 2018 16:04:57 GMT+0100 (GMT Daylight Time)] ERROR Child process exited with code 1
I can't understand why is so hard to add Yarn to a docker. I tried so many things and all fails in some ways or another.
Until yesterday I was able to install Yarn on my docker with RUN npm install -g yarn
but this morning stopped working with error:
request to https://registry.npmjs.org/yarn failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
Some of the things I've tried:
Edit one day after:
Now when I do yarn install
I'm getting getaddrinfo EAI_AGAIN registry.yarnpkg.com:443
errors on every package.
looks like restarting docker fixes it. Also more info at https://development.robinwinslow.uk/2016/06/23/fix-docker-networking-dns/
RUN set -eux \
& apk add \
--no-cache \
nodejs \
yarn
As dumb as it sounds, looks like yarn
is already installed in this docker version of node. So there is no need to install yarn
at all.
Anyway not sure why RUN npm install -g yarn
stopped working from one day to another.
The latest yarn
package is only available in the edge repository. This means, you should install it as follows (including the latest nodejs
version):
RUN apk --no-cache add nodejs yarn --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With