Yarn: docker node:10.18 npm install -g yarn fails EEXIST

Created on 18 Dec 2019  路  1Comment  路  Source: yarnpkg/yarn

This was a minor issue for us, but it made me think there could be a more significant bug with the npm package

Our docker file had npm install -g yarn in it because node didn't used to bundle yarn. This worked until today when 10.18 came out. Now there is:

#7 [tooling 3/3] RUN npm install -g cross-env gulp yarn
#7 12.75 /usr/local/bin/cross-env -> /usr/local/lib/node_modules/cross-env/src/bin/cross-env.js
#7 12.75 /usr/local/bin/cross-env-shell -> /usr/local/lib/node_modules/cross-env/src/bin/cross-env-shell.js
#7 12.76 /usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js
#7 12.88 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/gulp/node_modules/fsevents):
#7 12.88 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
#7 12.88 
#7 12.89 npm ERR! code EEXIST
#7 12.89 npm ERR! syscall symlink
#7 12.89 npm ERR! path ../lib/node_modules/yarn/bin/yarn.js
#7 12.89 npm ERR! dest /usr/local/bin/yarn
#7 12.89 npm ERR! errno -17
#7 12.89 npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/yarn/bin/yarn.js' -> '/usr/local/bin/yarn'
#7 12.89 npm ERR! File exists: /usr/local/bin/yarn
#7 12.89 npm ERR! Remove the existing file and try again, or run npm
#7 12.89 npm ERR! with --force to overwrite files recklessly.
#7 12.93 
#7 12.93 npm ERR! A complete log of this run can be found in:
#7 12.93 npm ERR!     /root/.npm/_logs/2019-12-18T19_43_40_501Z-debug.log
#7 ERROR: executor failed running [/bin/sh -c npm install -g cross-env gulp yarn]: runc did not terminate sucessfully

To repro:

  • docker run -it --rm --entrypoint bash node:10.18;
  • npm install -g yarn

Most helpful comment

Looks like yarn is already included into node-alpine at least

>All comments

Looks like yarn is already included into node-alpine at least

Was this page helpful?
0 / 5 - 0 ratings