google / js-green-licenses

JavaScript package.json License Checker
Apache License 2.0
178 stars 27 forks source link

Seeking workaround for git url #158

Open hagevvashi opened 3 years ago

hagevvashi commented 3 years ago

I have a problem about PackageNotFoundError.

If using github url for package.json (e.g. dependencies: { "package-a": "git+ssh://git@github.com/...." }), above error occurs after execute jsgl --local ..

The reason is package-json does not support git url and the issue is here.

As described above, I understand the unnecessity of fetching package from git url (because the aim of js-green-licenses is also for the open source library's license).

However, for some reasons (e.g. there are no private registries in the organization), it is not possible to remove those git url packages.

So I have 3 proposals.

  1. remove package directed to git url before iterating
  2. if package is allow-listed and is directed to git url, do not fetch from npm registry
  3. using git-package-json

At last I have a question.

Do you think which workaround is the best?