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

Scoped packages return 404 #99

Open
diervo opened this issue Dec 14, 2017 · 7 comments
Open

Scoped packages return 404 #99

diervo opened this issue Dec 14, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@diervo
Copy link

diervo commented Dec 14, 2017

Scoped packages return a 404, for example the command: npm info @types/node --registry=http://myregistry.com fails.

That being said it worked a couple of times so It might be related somehow with the issue #96 and #97, since it did work intermittently?

Note that in my server I do have applied the PR #98

@diervo
Copy link
Author

diervo commented Dec 14, 2017

Ok I found the root cause: There is a a bunch of race conditions in http-call library due to incorrect use of async/await.

The problem is described here: https://jakearchibald.com/2017/await-vs-return-vs-return-await/

Because of this the property req.body might be a string or JSON depending if the promise has been resolved.

@BobNobrain
Copy link

I still have this issue in 2.8.2 with env variable NPM_REGISTER_AUTH_READ=true. All scoped packages return 404, but everything else works as intended. In logs it says just something like this:

[API] measure#request=6ms method=GET user-agent="npm/6.4.1 node/v8.11.1 linux x64" status=404 path=/@nuxtjs/axios request_id=0.9942495738552943

@dgautsch dgautsch added this to the v2.8.3 milestone Oct 26, 2018
@dgautsch dgautsch added the bug label Oct 26, 2018
@dgautsch dgautsch reopened this Oct 26, 2018
@dgautsch dgautsch self-assigned this Oct 26, 2018
@giantryansaul
Copy link

I could use some help here. The service works well for me when I've deleted the lock file, but when I use a set yarn.lock file I run into frequent 404 errors. AFAIK all of the dependencies are otherwise available.

@dgautsch
Copy link
Collaborator

@BobNobrain @giantryansaul I'll review sometime this weekend and next week. Haven't had as much time for this project lately. But should have some free time over the holiday.

@dgautsch
Copy link
Collaborator

@giantryansaul when you say, set yarn.lock. do you mean the one committed with the project that comes with v2.8.3?

@giantryansaul
Copy link

@dgautsch No I mean the yarn lock file we use for our team's project. I've reset the "resolved" links from the public yarn registry so that they all get re-written to this new registry. All of these packages will download correctly from the public registry, but a handful of them (mostly @type libraries) will get 404 errors.

@silverlyra
Copy link

I just ran into this in switching from verdaccio to npm-register.

Most of the scoped packages in our yarn.lock files had URL-escaped /s within their tarball URLs, like https://npm.abc.xyz/@vx%2ftext/-/text-0.0.165.tgz. But some of them did not, and npm-register 404’d them: https://npm.abc.xyz/@vx/text/-/text-0.0.165.tgz won’t work. Looking through routes.js, it looks like those might work if the tarball name had a /hash suffix.

We used sed to url-escape all scoped package names in our yarn.lock files, and then our yarn installs started to complete successfully.

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

No branches or pull requests

6 participants