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.0

Instructions

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: