Repository navigation
Fix broken repository URL in package.json - #25
Conversation
GitHub hasn't supported the git protocol [since 2022](https://github.blog/security/application-security/improving-git-protocol-security-github/#no-more-unauthenticated-git), so this URL is broken. (This is a common error affecting many popular npm packages; I'm opening PRs on several projects to fix it. I encourage anyone reading this to check any packages they maintain and implement the same fix if appropriate!)
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/nodejs/string_decoder.git" | ||
| "url": "https://github.com/nodejs/string_decoder.git" |
There was a problem hiding this comment.
| "url": "https://github.com/nodejs/string_decoder.git" | |
| "url": "git+https://github.com/nodejs/string_decoder.git" |
npm pkg fix normalizes to the protocol git+https
See https://docs.npmjs.com/cli/v12/configuring-npm/package-json#repository
There was a problem hiding this comment.
That seems bizarre - that's not even valid syntax for a Git remote! If you try doing git clone 'git+https://github.com/nodejs/string_decoder' or setting such a remote in your .git/config, it will fail. I have no idea why npm pkg fix wants you to set your remote URL to something that from Git's perspective isn't even syntactically valid, but personally, I would ignore it.
There was a problem hiding this comment.
You'll find it on more up to date packages like https://github.com/nodejs/undici/blob/main/package.json
I don't know if this repo is ever going to be republished. The last publication was 7 years ago. So it may be that the change never gets used.
I just happened to notice your PR when I was looking at other things in this repo.
Also used by npm itself:
"repository": {
"type": "git",
"url": "git+https://github.com/npm/cli.git"
},
GitHub hasn't supported the git protocol since 2022, so this URL is broken.
(This is a common error affecting many popular npm packages; I'm opening PRs on several projects to fix it. I encourage anyone reading this to check any packages they maintain and implement the same fix if appropriate!)