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

highcharts license incorrectly reported using highcharts-server license URL #254

Open
loop-evgeny opened this issue Oct 14, 2021 · 1 comment

Comments

@loop-evgeny
Copy link

package.json file:

{
  "dependencies": {
    "react-highcharts": "^16.1.0"
  }
}

Run

npm i
license-checker --packages "highcharts@6.2.0"

Output:

└─ highcharts@6.2.0
   ├─ licenses: Custom: https://www.npmjs.com/package/highcharts-server
...

However, node_modules/highcharts/package.json has this:

"license": "https://www.highcharts.com/license"

The difference is significant, because highcharts-server is MIT-licensed, while highcharts has a commercial license.

@joelwkall
Copy link

I've been investigating this, and found some interesting tidbits:

  • license-checker uses read-installed to traverse the tree of installed packages. read-installed returns a data structure that has a few properties, one of which is readme, another is license.
  • If there is no readme, license-checker will read the README.md file of the package and put that string in the readme property of the data returned from read-installed.
  • If there is no license or licenses property in the data returned from read-installed, license-checker will use the readme property and look for licenses in there instead, using a bunch of regexes, one of which is an URL regex.
  • The README.md file for highcharts@6.2.0 contains a link to https://www.npmjs.com/package/highcharts-server early on.
  • My guess is that for some reason, read-installed does not properly return the license property of this package, causing license-checker to grab the incorrect URL from the README.md instead.
  • Remaining question is why read-installed does not return the license property of highcharts@6.2.0, even though it clearly has such a property in its package.json

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

No branches or pull requests

2 participants