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

yarn install fails on empty string license with no warning #767

Closed
FLGMwt opened this issue Oct 11, 2016 · 0 comments
Closed

yarn install fails on empty string license with no warning #767

FLGMwt opened this issue Oct 11, 2016 · 0 comments

Comments

@FLGMwt
Copy link
Contributor

FLGMwt commented Oct 11, 2016

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Given a package.json with license: "", yarn fails with:

error TypeError: [email protected]: Cannot read property 'toUpperCase' of undefined
    at Array.<anonymous> (C:\Program Files (x86)\Yarn\node_modules\spdx-correct\index.js:82:23)
    at validTransformation (C:\Program Files (x86)\Yarn\node_modules\spdx-correct\index.js:173:36)
    at module.exports (C:\Program Files (x86)\Yarn\node_modules\spdx-correct\index.js:215:21)
    at module.exports (C:\Program Files (x86)\Yarn\node_modules\validate-npm-package-license\index.js:60:23)
    at isValidLicense (C:\Program Files (x86)\Yarn\lib\util\normalize-manifest\util.js:16:10)
    at exports.default (C:\Program Files (x86)\Yarn\lib\util\normalize-manifest\validate.js:53:55)
    at C:\Program Files (x86)\Yarn\lib\util\normalize-manifest\index.js:50:30
//...

If the current behavior is a bug, please provide the steps to reproduce.
Create a package.json with the license value ""

What is the expected behavior?
If a license key is present, but with an invalid value, output should be

warning [email protected]: License should be a valid SPDX license expression

As it is with license values such as "ASDFASDFqwertyqwerty"

Please mention your node.js, yarn and operating system version.
node v6.2.1
yarn 0.15.1
Windows 10

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