google / js-green-licenses

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

semver parsing issue with leading zeros #103

Open lindner opened 5 years ago

lindner commented 5 years ago

I believe that the following library is failing to be found due to leading zeros in the version. This may be a semver issue.

Here's the error that I am seeing:

Error while checking esprima-fb@~3001.0001.0000-dev-harmony-fb:
  arcs-server@1.0.0 -> express-pouchdb@4.1.0 -> pouchdb-all-dbs@1.0.2 -> es3ify@0.1.4 -> esprima-fb@~3001.0001.0000-dev-harmony-fb

{ VersionNotFoundError: Version `~3001.0001.0000-dev-harmony-fb` for package `esprima-fb` could not be found
    at Object.packageJson [as default] (/Users/plindner/arcs/storage-pouchdb/server/node_modules/package-json/index.js:87:23)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'VersionNotFoundError' }
JustinBeckwith commented 3 years ago

Greetings! Sorry for the comically lengthy delay. Can you share some reproduction steps for this? I am having a little trouble causing this failure. What I tried:

mkdir espirrrr
cd espirrrr
npm init -y
npm install express-pouchdb@4.1.0
npx jsgl --local .

That leads to this output:

$ npx jsgl --local .
Checking package.json...

WTFPL: argsarray@0.0.1
  espirrrr@1.0.0 -> express-pouchdb@4.2.0 -> pouchdb-all-dbs@1.1.1 -> argsarray@0.0.1

WTFPL: spark-md5@3.0.1
  espirrrr@1.0.0 -> express-pouchdb@4.2.0 -> pouchdb-find@7.2.2 -> pouchdb-abstract-mapreduce@7.2.2 -> pouchdb-mapreduce-utils@7.2.2 -> pouchdb-utils@7.2.2 -> pouchdb-md5@7.2.2 -> spark-md5@3.0.1

WTFPL: truncate-utf8-bytes@1.0.2
  espirrrr@1.0.0 -> express-pouchdb@4.2.0 -> sanitize-filename@1.6.3 -> truncate-utf8-bytes@1.0.2

WTFPL: utf8-byte-length@1.0.4
  espirrrr@1.0.0 -> express-pouchdb@4.2.0 -> sanitize-filename@1.6.3 -> truncate-utf8-bytes@1.0.2 -> utf8-byte-length@1.0.4

4 non-green licenses found.

Thanks!