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

Path in registry URL no longer respected if it does not end with a trailing slash #4052

Closed
aholtkamp opened this issue Nov 30, 2021 · 15 comments · Fixed by #4053 or #4059
Closed

Path in registry URL no longer respected if it does not end with a trailing slash #4052

aholtkamp opened this issue Nov 30, 2021 · 15 comments · Fixed by #4053 or #4059

Comments

@aholtkamp
Copy link

pnpm version: 6.23.x

Code to reproduce the issue:

pnpm config set registry https://some.company.com/some-registry
pnpm install

Expected behavior:

The path "some-registry" is respected.

Actual behavior:

The path "some-registry" is ignored

Additional information:

Caused by #4032

This is an undocumented breaking change in a minor version update leading to not being able to upgrade pnpm in our company without adjusting our CI.

@zkochan
Copy link
Member

zkochan commented Nov 30, 2021

I did not consider it to be a breaking because I was trying to make pnpm process the registry configuration the same way as the npm CLI does it. So I guess your current configuration doesn't work with npm as well? Could you check if it works with npm CLI?

@zkochan
Copy link
Member

zkochan commented Nov 30, 2021

I have downgraded latest to 6.23.1 for now.

@zkochan
Copy link
Member

zkochan commented Nov 30, 2021

@aholtkamp what exactly is the problem? What error do you get? Are the requests going to the wrong URL or is this an auth error? How do you set the auth token?

@aholtkamp
Copy link
Author

aholtkamp commented Dec 1, 2021

Thanks for the quick response!
We recently switched from a (very buggy) npm 7 to pnpm and always provided the registry without a trailing slash. I double checked this using npm 7.x and it still works.

Regarding the question what the actual error is: When setting e.g. https://some.company.com/some-registry I get the error that my packages cannot be found below https://some.company.com/some-package/. Before 6.23.x the packages very correctly looked up below https://some.company.com/some-registry/some-package/

@zkochan
Copy link
Member

zkochan commented Dec 1, 2021

ok, I think this PR should fix it: #4053

@zkochan
Copy link
Member

zkochan commented Dec 1, 2021

Do the entries in your lockfile look like this

pnpm/pnpm-lock.yaml

Lines 9313 to 9316 in 8a99a01

/get-npm-tarball-url/2.0.3:
resolution: {integrity: sha512-R/PW6RqyaBQNWYaSyfrh54/qtcnOp22FHCCiRhSSZj0FP3KQWCsxxt0DzIdVTbwTqe9CtQfvl/FPD4UIPt4pqw==}
engines: {node: '>=12.17'}
dev: false

Or does the "resolution" field contain more fields?

@aholtkamp
Copy link
Author

aholtkamp commented Dec 1, 2021

Our pnpm-lock.yaml is quite big but flying over the entries it looks like the "resolution" field does only contain "integrity" like in your example.

@zkochan
Copy link
Member

zkochan commented Dec 1, 2021

In that case probably my pull request won't help. I have found an issue but only when the lockfile's resolution fields contain the "tarball" field.

@zkochan
Copy link
Member

zkochan commented Dec 1, 2021

Try 6.23.4. It is not latest, so you'll need to explicitly install it.

@aholtkamp
Copy link
Author

I have upgraded to 6.23.4 but it didn't fix the issue.

@zkochan
Copy link
Member

zkochan commented Dec 2, 2021

it should work with 6.23.5

@zkochan
Copy link
Member

zkochan commented Dec 2, 2021

@aholtkamp could you verify the fix in the latest version of pnpm?

@aholtkamp
Copy link
Author

I can confirm that 6.23.5 works, thanks!

@zkochan
Copy link
Member

zkochan commented Dec 4, 2021

I think I know what caused the regression in my change. Try pnpm v6.23.7-202112041634

@aholtkamp
Copy link
Author

v6.23.7-202112041634 also works for us

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