I have a react application that installs its dependencies via yarn install. When I run this command, I get the following No license field related warnings.
warning package.json: No license field
warning react-material-dashboard@0.3.0: No license field
Then I updated, the package.json file's private property to be true. (See NPM docs)
{
"name": "some-application-name",
"author": "Keet Sugathadasa",
"email": "email",
"licence": "MIT",
"version": "0.0.1",
"private": true,
...
}
Now, all warnings related to No license field disappeared. Why?
The warning complains about there not being a license field (with an s), you do however have a licence field (with a c), correct the spelling and the warning should disappear.
The reason that setting "private": true works and prevents the warning from appearing is that private packages don't get distributed and therefore do not need a license.