Skip to content
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

Docker build failed to update nodejs12.x with error in yarn to be installed globally #7868

Open
NirajCricket opened this issue Feb 3, 2020 · 2 comments

Comments

@NirajCricket
Copy link

I am running a nodejs upgrade to 14.x, received yarn install globall error in docker build.

My Issue:
I am seeing error when one of the docker step to install yarn globally errored.

I am using Docker, and can able to install yarn globally in my local.

npm ERR! dest /usr/local/bin/yarn
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/yarn/bin/yarn.js' -> '/usr/local/bin/yarn'
npm ERR! File exists: /usr/local/bin/yarn
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-02-03T02_25_21_511Z-debug.log
The command '/bin/sh -c npm install yarn -g' returned a non-zero code: 239

I am running current Docker version:
Docker version 18.09.2, build 6247962

Environment

  • Node Version: 12.14.1
  • Yarn v1 Version: 1.10.1
  • OS and version: Windows/Linux
@NirajCricket
Copy link
Author

Solution : followed steps:

Install Yarn globally

Runs after package.json is copied to ensure we run the latest version of Yarn on dependency changes

RUN rm /usr/local/bin/yarn
RUN rm /usr/local/bin/yarnpkg && npm install -g yarn

@Daniel15
Copy link
Member

Daniel15 commented Feb 3, 2020

You should probably be using the Yarn Debian package in Docker (assuming you're using a Debian-based Docker image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants