Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM - No license field

Tags:

npm

I am trying to use the following command on the integrated terminal on Visual Studio Code: npm install

However, an error has been displayed. It says, "npm WARN package.json [email protected] No license field." What should I do to fix this issue?

like image 906
john Avatar asked Sep 05 '17 05:09

john


People also ask

What does unlicensed mean npm?

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" } Thisisnottobeconfusedwiththelicensethatwasconfusinglycalled"TheUnlicense". Follow this answer to receive notifications.

How is npm licensed?

The NPM license is based on a number of items to monitor. Each license tier number provides the maximum limit of nodes, interfaces, and volumes to manage and monitor. Orion Platform products support both perpetual licenses and subscription licenses. See License types in the Orion Platform help for details.

Can you install npm without root?

npm installs packages locally within your projects by default. You can also install packages globally (e.g. npm install -g <package> ) (useful for command-line apps). However the downside of this is that you need to be root (or use sudo ) to be able to install globally.


2 Answers

Add a license attribute in your package.json file, e.g:

{ 
  "name": "...."
  ...
  "license" : "SEE LICENSE IN <filename>" 
}

If you are working on an open source package with an OSI-approved license, use it's identifier from this list as value for the license attribute.

Here is the specification of the package.json format: https://docs.npmjs.com/files/package.json

like image 81
Harald Gliebe Avatar answered Nov 10 '22 12:11

Harald Gliebe


Add this to your package.json:

{
    "license" : "MIT license" 
}

If your software is opensource.

You can have some examples to use on: https://opensource.org/licenses

like image 35
Welyngton Dal Prá Avatar answered Nov 10 '22 13:11

Welyngton Dal Prá