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

yarn 1.x 404's on private packages #4422

Closed
jquense opened this issue Sep 12, 2017 · 14 comments
Closed

yarn 1.x 404's on private packages #4422

jquense opened this issue Sep 12, 2017 · 14 comments
Assignees

Comments

@jquense
Copy link

jquense commented Sep 12, 2017

private packages fail to install in CI. It should be noted that this repo is using workspaces, but I cannot confirm that that it works in a non-workspaces case.

What is the current behavior?

yarn install v1.0.1-20170912.1314
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@mycompany/sunburst/-/sunburst-0.2.2.tgz: Request failed \"404 Not Found\"".

If the current behavior is a bug, please provide the steps to reproduce.

This happens in a Docker container on Circle CI where the previous step is to

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
mkdir -p ~/yarn-cache
yarn install --cache-folder ~/yarn-cache

This works on yarn 0.28.x

Please mention your node.js, yarn and operating system version.

docker/node:8
yarn latest nightly

@BYK
Copy link
Member

BYK commented Sep 12, 2017

yarn install v1.0.1-20170912.1314

This is not the latest nightly. Can you try the actual latest one: https://nightly.yarnpkg.com/yarn-1.0.1-20170912.1621.js

This should include #4367 which should be the final fix regarding auth and scoped packages.

@BYK BYK self-assigned this Sep 12, 2017
@jquense
Copy link
Author

jquense commented Sep 12, 2017

gladly! i'm not sure how to do that tho we used: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly and that's what came down

@BYK
Copy link
Member

BYK commented Sep 12, 2017

@jquense it is probably because I've merged it quite recently and then builds take some time. Sorry for the repeated work and thanks a lot for helping!

@jquense
Copy link
Author

jquense commented Sep 12, 2017

np thanks for all the speedy work. I'm pulling it down now and trying

@jquense
Copy link
Author

jquense commented Sep 12, 2017

🌈 🌈 ⭐️ 🎉 🎉 That did it! Sorry for the noise. THANKS!

@jquense jquense closed this as completed Sep 12, 2017
@BYK
Copy link
Member

BYK commented Sep 12, 2017

That did it! Sorry for the noise. THANKS!

No worries, thanks for helping!

@darkobits
Copy link

Also experiencing this issue after upgrading to 1.x.

Any idea when this fix will be officially released?

@BYK
Copy link
Member

BYK commented Sep 12, 2017

Any idea when this fix will be officially released?

In a few days. In the meantime you can use the nightlies: https://yarnpkg.com/en/docs/nightly

@jedwards1211
Copy link

@BYK the fix was released in 1.0.2? I think I'm still seeing issues

@jedwards1211
Copy link

jedwards1211 commented Sep 20, 2017

@BYK for some reason it fails when I use yarn 1.0.2 in docker, but not on my local machine...

FROM node:8.5
MAINTAINER Andy Edwards

RUN npm install --global yarn@^1.0.2

WORKDIR /usr/app/build

ARG NPM_TOKEN

RUN echo $NPM_TOKEN

# Project uses private NPM modules. Pass in NPM token externally.
# Tell NPM to use the token from the environment variable
RUN echo "registry=https://registry.npmjs.org/" > /usr/app/build/.npmrc
RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > /usr/app/build/.npmrc
RUN echo 'registry "https://registry.npmjs.org"' > /usr/app/build/.yarnrc

ARG NODE_ENV=production
ARG TARGET=""
ARG BUILD_DIR=build

ENV NODE_ENV=$NODE_ENV \
    TARGET=$TARGET

COPY package.json yarn.lock /usr/app/build/

RUN yarn --pure-lockfile
docker build . --build-arg NPM_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX --no-cache
...
Step 17/22 : RUN yarn --pure-lockfile
 ---> Running in 4cbf8ef83d66
yarn install v1.0.2
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/@jcoreio/gridutil/-/gridutil-1.0.10.tgz: Request failed \"404 Not Found\"".

@darkobits
Copy link

I can confirm this is still an issue (with Docker in Jenkins, in my case) in 1.0.2.

@xogeny
Copy link

xogeny commented Sep 22, 2017

Have the issues with Docker + 1.0.2 been resolved? If not, shouldn't this be re-opened?

@jedwards1211
Copy link

With 1.3.2 at least, I'm not seeing this error anymore.

Additionally, there was a bug in my Dockerfile above. One of my echo commands overwrites the other:

RUN echo "registry=https://registry.npmjs.org/" > /usr/app/build/.npmrc
RUN echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > /usr/app/build/.npmrc

The second command should use >> instead of >.

@sundowndev
Copy link

I had the same issue with a 503 error, adding registry=https://registry.npmjs.org/ to .npmrc fixed it.

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

6 participants