`yarn` not found in `node:alpine`
I'm using the node:alpine image in a gitlab-ci build.
Since a few minutes ago I get the following error in gitlab-ci:
$ yarn config set cache-folder .yarn
/bin/sh: eval: line 50: yarn: not found
ERROR: Job failed: exit code 127
My .gitlab-ci.yaml:
build:
image: node:alpine
stage: build
script:
- yarn config set cache-folder .yarn
- yarn
- yarn build
I'm seeing the same in circleci
Step 6/9 : RUN yarn
---> Running in a8731d6619d5
/bin/sh: yarn: not found
The command '/bin/sh -c yarn' returned a non-zero code: 127
I'm experiencing the same issue.
Same here. Need to revert ae26d217bca933e72ac5f8de946681c1b5f8b37e.
Same for the normal node:9.8.0
~ » docker run -it --rm node:9.8.0 sh
# yarn
sh: 1: yarn: not found
Same here with node:carbon
This was caused by this commit: https://github.com/nodejs/docker-node/commit/ae26d217bca933e72ac5f8de946681c1b5f8b37e
Given the way the symlink is done mkdir -p /opt/yarn should have been deleted
node:9.7-alpine image seems unaffected
@PeterDaveHello @chorrell
Seems to affect all supported tags except chakracore.
The problem is with mkdir -p /opt/yarn (related to missing /opt directory see #648).
The correct command should be mkdir -p /opt.
latest is affected I think:
The link /usr/local/bin/yarn is broken, it targets /opt/yarn/bin/yarn which doesn't exist. But /opt/yarn/yarn-v1.5.1 exists.
root@5706d42db0c6:/# ls /usr/local/
CHANGELOG.md LICENSE README.md bin etc games include lib man sbin share src
root@5706d42db0c6:/# ls /usr/local/bin
node nodejs npm npx yarn yarnpkg
root@5706d42db0c6:/# /usr/local/bin/yarn
bash: /usr/local/bin/yarn: No such file or directory
root@5706d42db0c6:/# ls /usr/local/bin
node nodejs npm npx yarn yarnpkg
root@5706d42db0c6:/# stat /usr/local/bin/yarn
File: '/usr/local/bin/yarn' -> '/opt/yarn/bin/yarn'
Size: 18 Blocks: 0 IO Block: 4096 symbolic link
Device: 31h/49d Inode: 62 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2018-03-16 10:19:06.000000000 +0000
Modify: 2018-03-16 10:19:06.000000000 +0000
Change: 2018-03-16 11:13:53.243600600 +0000
Birth: -
root@5706d42db0c6:/# /usr/local/bin/yarn
bash: /usr/local/bin/yarn: No such file or directory
root@5706d42db0c6:/# /usr/local/bin/n
node nodejs npm npx
root@5706d42db0c6:/# /usr/local/bin/yarn
bash: /usr/local/bin/yarn: No such file or directory
root@5706d42db0c6:/# /opt/yarn/bin/yarn
bash: /opt/yarn/bin/yarn: No such file or directory
root@5706d42db0c6:/# ls /opt/yarn
yarn-v1.5.1
root@5706d42db0c6:/# ls /opt/yarn/yarn-v1.5.1
LICENSE README.md bin lib package.json
root@5706d42db0c6:/# ls /opt/yarn/yarn-v1.5.1
Broke our CI as well this morning!
Should #639, #647 and #648 all be reverted, or can someone send a new PR fixing it?
Same here, with every version of node. We've already tried carbon and latest. Both fail with the yarn command.
This affects 9.8.0, 9.8, 9, latest, 8.10.0, 8.10, 8, carbon, 6.13.1, 6.13, 6, boron, 4.8.7, 4.8, 4, argon and all variants (alpine, slim, onbuild, wheezy, stretch)
@SimenB I volunteer to make a PR. I will remove the mkdir -p and replace by a symlink where the yarn has been decompressed.
@cecton thanks!
I will be able to fix that in several hours. If anyone can take care of it earlier, please do.
I asked for a revert in https://github.com/docker-library/official-images/pull/4131, but I think they are all on the west coast of the US, so probably asleep.
Adding the following to my Dockerfile as a temporary fix helped. Remember YMMV!
RUN mkdir -p /opt/yarn/bin && ln -s /opt/yarn/yarn-v1.5.1/bin/yarn /opt/yarn/bin/yarn