"All Rights Reserved" package.json 许可证
"All Rights Reserved" license in package.json
我有一个小型 node.js 公司内部项目,不会 public 发布或与第三方共享。它肯定不会贡献给任何 public 包存储库。
但是当我 运行 npm install
我总是得到以下错误:
npm WARN package.json <<myproject>>@0.1.0 license should be a valid SPDX license expression
所需的许可证是:"copyright by us and all rights reserved"。我找不到任何看起来适用于 SPDX license list. The suggestion in this answer 的东西也不起作用。如果我只是从 package.json
中删除 license
字段,错误将更改为 no license field
.
如何让 npm install
不显示错误或警告而不在其中放置我们不想使用的许可证参考?
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.
根据新的 npm 规范,如果您不希望根据任何条款授予他人使用私有或未发布包的权利,您可以使用 { "license": "UNLICENSED"}
。
请参考完整详情here
所以你可能不会得到你提到的错误。
UNLICENSED 表示它没有许可,而“unlicense”,末尾没有“d”,指的是名为 The Unlicense 的许可,这是非常不同的。为防止混淆,如果您想声明版权,您应该将某人指向您自己的内部许可文件。
绝对不要使用:
{ "license": "unlicense" }
如果您想清楚地表明您希望拥有版权声明式许可,请按照投票最高的答案的建议。
UNLICENSE 许可的前两段中的一段剪辑清楚地表明这与 OP 提出版权声明的请求完全无关:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
感谢投票最多的答案,Node 文档页面声称使用 UNLICENSED 选项是为了让您不会向其他人授予任何权利:
if you do not wish to grant others the right to use a private or unpublished package under any terms:
这似乎不是保留您的权利的安全选择。你可以推断缺少额外的“D”意味着这是两个完全不同的术语,但你不能假设其他人会知道这一点,并且当他们搜索什么是 UNLICENSED 许可证时,他们可能会得到 link 到 The Unlicense.
因此,以下内容:
{ "license": "SEE LICENSE IN <filename>" }
是目前比较安全的答案。
还可以考虑添加 "private": true
,这将导致 npm 阻止任何包的发布。
所以在 package.json 中:
"license": "UNLICENSED",
"private": true,
参考:https://docs.npmjs.com/cli/v7/configuring-npm/package-json
我有一个小型 node.js 公司内部项目,不会 public 发布或与第三方共享。它肯定不会贡献给任何 public 包存储库。
但是当我 运行 npm install
我总是得到以下错误:
npm WARN package.json <<myproject>>@0.1.0 license should be a valid SPDX license expression
所需的许可证是:"copyright by us and all rights reserved"。我找不到任何看起来适用于 SPDX license list. The suggestion in this answer 的东西也不起作用。如果我只是从 package.json
中删除 license
字段,错误将更改为 no license field
.
如何让 npm install
不显示错误或警告而不在其中放置我们不想使用的许可证参考?
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.
根据新的 npm 规范,如果您不希望根据任何条款授予他人使用私有或未发布包的权利,您可以使用 { "license": "UNLICENSED"}
。
请参考完整详情here
所以你可能不会得到你提到的错误。
UNLICENSED 表示它没有许可,而“unlicense”,末尾没有“d”,指的是名为 The Unlicense 的许可,这是非常不同的。为防止混淆,如果您想声明版权,您应该将某人指向您自己的内部许可文件。
绝对不要使用:
{ "license": "unlicense" }
如果您想清楚地表明您希望拥有版权声明式许可,请按照投票最高的答案的建议。
UNLICENSE 许可的前两段中的一段剪辑清楚地表明这与 OP 提出版权声明的请求完全无关:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
感谢投票最多的答案,Node 文档页面声称使用 UNLICENSED 选项是为了让您不会向其他人授予任何权利:
if you do not wish to grant others the right to use a private or unpublished package under any terms:
这似乎不是保留您的权利的安全选择。你可以推断缺少额外的“D”意味着这是两个完全不同的术语,但你不能假设其他人会知道这一点,并且当他们搜索什么是 UNLICENSED 许可证时,他们可能会得到 link 到 The Unlicense.
因此,以下内容:
{ "license": "SEE LICENSE IN <filename>" }
是目前比较安全的答案。
还可以考虑添加 "private": true
,这将导致 npm 阻止任何包的发布。
所以在 package.json 中:
"license": "UNLICENSED",
"private": true,
参考:https://docs.npmjs.com/cli/v7/configuring-npm/package-json