According to the new npm specification you can use { "license": "UNLICENSED"} if you do not wish to grant others the right to use a private or unpublished package under any terms.
Please refer the full details here
So you might not get the error you mentioned.
According to the latest docs for package.json:
If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use the following valid SPDX expression:
{ "license" : "SEE LICENSE IN <filename>" }Then include a file named
<filename>at the top level of the package.
Use UNLICENSED per the npm docs:
Finally, if you do not wish to grant others the right to use a private or unpublished package under any terms:
{
"license": "UNLICENSED"
}
This is not to be confused with the license that was confusingly called "The Unlicense".
at the time of writing UNLICENSED (see the code sample in the question) was not an option please see jcollum's answer
Adding private to package.json will help:
"private": true
» npm install spdx-license-ids