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

Null pointer exception when checking license of brand new React project #232

Open
danielthegray opened this issue Mar 10, 2020 · 0 comments

Comments

@danielthegray
Copy link

danielthegray commented Mar 10, 2020

I simply installed licence-checker using npm install -g license-checker.

Steps to reproduce (this occurred on a Windows environment):

  1. Create a new skeletal React app:
npx create-react-app my-app --template typescript
  1. Enter the new app
cd my-app
  1. Execute the following command:
license-checker --production --csv --exclude 'CC-BY-3.0, CC-BY-4.0, CC0-1.0, Public Domain, Unlicense, WTFPL, MIT, Zlib, ISC, BSD, OFL-1.1, MPL-2.0, Apache-2.0'

You will see the following error:

C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:52
    if (t.type === 'DOCUMENTREF') {
          ^

TypeError: Cannot read property 'type' of null
    at parseLicenseRef (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:52:11)
    at parseAtom (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:102:7)
    at parseBinaryOp (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:109:18)
    at parseBinaryOp (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:109:18)
    at module.exports (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\parse.js:133:14)
    at module.exports (C:\tools\node12\node_modules\license-checker\node_modules\spdx-expression-parse\index.js:7:10)
    at module.exports (C:\tools\node12\node_modules\license-checker\node_modules\spdx-satisfies\index.js:117:29)
    at C:\tools\node12\node_modules\license-checker\lib\index.js:390:64
    at Array.forEach (<anonymous>)
    at C:\tools\node12\node_modules\license-checker\lib\index.js:376:30
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

1 participant