npm, Adding a CC0 License to package.json
Filed under: npm
When installing dependencies for a new phoenix project, I got the following warning. npm WARN package.json @ No license field.
This post covers fixing that problem by specifying a CC0 license.
Software Versions
$ date
February 3, 2016 at 04:05:29 AM JST
$ uname -mv
FreeBSD 11.0-CURRENT #0 r287598: Thu Sep 10 14:45:48 JST 2015 root@:/usr/obj/usr/src/sys/MIRAGE_KERNEL amd64
$ npm --version
2.14.7
$ node --version
v5.5.0Instructions
Add the following line to package.json.
"license": "CC0-1.0",The file should look something like this.
{
"license": "CC0-1.0",
"repository": {
},
"dependencies": {
}
}SPDX maintains a list of valid license identifiers.
References
General Sources
- “Creative Commons Zero v1.0 Universal.” n.d. Accessed October 25, 2026. https://spdx.org/licenses/CC0-1.0.html
- “Package.json | Npm Documentation.” n.d. Accessed October 25, 2026. https://docs.npmjs.com/files/package.json
- “SPDX License List.” n.d. Accessed October 25, 2026. https://spdx.org/licenses/