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

Fixes offline mirror filename calculation for scoped packages URLs in the taobao npm registry #7533

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Axure
Copy link

@Axure Axure commented Sep 6, 2019

Summary

The taobao registry gives tarball urls for scoped packages in formats like https://registry.npm.taobao.org/@types/prop-types/download/@types/prop-types-15.7.2.tgz, which cannot be parsed by the current regex /\/(?:(@[^/]+)(?:\/|%2f))?[^/]+\/(?:-|_attachments)\/(?:@[^/]+\/)?([^/]+)$/. The result will thus fallback to prop-types-15.7.2.tgz which conflicts with the cache for the package prop-types. This will result in checksum mismatch.

Fix #7532.

Test plan

Added a test in __tests__/fetchers.js.

@Axure
Copy link
Author

Axure commented Sep 6, 2019

Lint seems to have failed on master since #7512

@Axure
Copy link
Author

Axure commented Oct 8, 2019

@arcanis Please have a look?

Merge to fix unit test.
@PLQin
Copy link

PLQin commented Oct 9, 2019

I also had this problem:

error https://registry.npm.taobao.org/@types/events/download/@types/events-3.0.0.tgz: Integrity check failed for "@types/events"
(computed integrity doesn't match our records, got "sha1-KGLz9Yqaf3w+eNefEw3U1xwlwqc=")

@xyy94813
Copy link

I got same issue with events and @types/events.

@xiaoxiangmoe
Copy link

@arcanis Please have a look. Thanks.

Copy link

@xyy94813 xyy94813 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is the most easy way to resolve this issue.

@jpli
Copy link

jpli commented Nov 8, 2019

This would fix my problem with react-router-dom and @types/react-router-dom.

@Axure
Copy link
Author

Axure commented Feb 25, 2020

Is yarn 1 no longer maintained?

@kidonng
Copy link

kidonng commented Feb 25, 2020

Is yarn 1 no longer maintained?

https://dev.to/arcanis/introducing-yarn-2-4eh1#what-will-happen-to-the-legacy-codebase

Yarn 1.22 will be released next week. Once done, the 1.x branch will officially enter maintenance mode - meaning that it won't receive further releases from me except when absolutely required to patch vulnerabilities. New features will be developed exclusively against Yarn 2.

I doubt if this is still an issue on Yarn 2 because it seems related code has been refactored:

https://github.com/yarnpkg/berry/blob/master/packages/plugin-http/sources/TarballHttpFetcher.ts#L7-L16

https://github.com/yarnpkg/berry/blob/master/packages/plugin-http/sources/constants.ts#L1-L3

@codering
Copy link

Plz merge this.

@UNDERCOVERj
Copy link

i have the same problem

@xiaoxiangmoe
Copy link

Is yarn 1 no longer maintained?

Copy link

@JdaieLin JdaieLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

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

Successfully merging this pull request may close these issues.

Incorrect offline mirror filename calculation with scoped packages URLs on the taobao npm registry
9 participants