Skip to content

Error installing private packages with latest yarn (worked/works in 0.27) #4690

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

Open
EdwardDrapkin opened this issue Oct 11, 2017 · 3 comments

Comments

@EdwardDrapkin
Copy link

EdwardDrapkin commented Oct 11, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
error An unexpected error occurred: "https://registry.npmjs.org/@private/a-private-package.tgz: Request failed "404 Not Found"".

I'm trying to install a private package by creating / copying a .npmrc file in my Dockerfile. I'm using the docker image node:alpine and I've upgraded yarn to latest to make sure it's on the latest.

I've tried:

always-auth=true
https://registry.npmjs.org/:_authToken=${NPM_TOKEN}
always-auth=true
https://registry.npmjs.org/:_authToken=XXXXXXXXX (the actual value)

I've tried with and without always-auth both ways as well.

My .npmrc is created in the Dockerfile:

FROM node:alpine

ARG npm_token
ENV NPM_TOKEN=$npm_token

ADD build/ .

RUN npm i -g yarn
RUN echo "always-auth=true" > .npmrc
RUN echo "https://registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc

RUN cat .npmrc

RUN yarn

And every time a 404. I've tried almost everything I can find in any comment on any ticket related to this, so what am I doing wrong? Why is this such a longstanding issue? At one point this exact Dockerfile was working, but since I've upgraded to 1.X it has not. This happens on every single one of our private packages.

@EdwardDrapkin
Copy link
Author

EdwardDrapkin commented Oct 11, 2017

FWIW, downgrading to 0.27 successfully fetches with the only change to the above Dockerfile: RUN npm i -g yarn => RUN npm i -g [email protected].

This is a pretty massive regression!

@EdwardDrapkin EdwardDrapkin changed the title Error installing private packages with latest yarn Error installing private packages with latest yarn (worked/works in 0.27) Oct 11, 2017
@avindra
Copy link

avindra commented Oct 12, 2017

Dupe of #4672

@yacinehmito
Copy link

@arcanis This could be closed (sorry for the mention, I don't know of any other maintainer).

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

3 participants