package.json-validator
package.json-validator copied to clipboard
🐛 Bug: Add support for GitHub URLs in dependencies
I'm currently trying to get my package.json valided before submiting a new package. However, the validation is faling since I'm trying to use GitHub URLs in my dependencies.
From the npm docs:
As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project".
However, if I use the following de
"dependencies": {
"foo": "user/foo-project"
}
package.json-validator tell me that my package.json is not valid:
package.json is NOT valid
{ valid: false,
errors: [ 'Invalid version range for dependency foo: user/foo-project' ] }
The commit to fix this looks like it's been open for a while, we are currently working around it by adding the git://github.com/
prefix which works for some reason.
Documented here https://docs.npmjs.com/files/package.json#urls-as-dependencies
Any update on this? I'm facing the same issue.
Per https://docs.npmjs.com/cli/v10/configuring-npm/package-json#github-urls, shorthand GitHub URLs -with or without branch/commit/etc. specifiers- should be supported. It's a bug that they're not. Accepting PRs!