node.js package.json 中的“保留所有权利”许可
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31998202/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"All Rights Reserved" license in package.json
提问by wberry
I have a small node.js project that is company-internal and will not be released publicly or shared with third parties. It certainly will not be contributed to any public package repositories.
我有一个公司内部的小型 node.js 项目,不会公开发布或与第三方共享。它当然不会贡献给任何公共包存储库。
But when I run npm installI always get the following error:
但是当我运行时,npm install我总是收到以下错误:
npm WARN package.json <<myproject>>@0.1.0 license should be a valid SPDX license expression
The desired license is: "copyright by us and all rights reserved". I could not find anything that looked applicable in the SPDX license list. The suggestion in this answerdoes not work either. If I simply remove the licensefield from package.jsonthe error changes to no license field.
所需的许可是:“版权归我们所有,保留所有权利”。我在SPDX 许可证列表中找不到任何看起来适用的内容。此答案中的建议也不起作用。如果我只是license从package.json错误中删除该字段,则更改为no license field.
How do I get npm installto show no errors or warnings without putting a license reference in there that we do not want to use?
如果npm install没有在其中放置我们不想使用的许可证参考,我如何才能不显示错误或警告?
回答by kds
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.
根据新的 npm 规范,{ "license": "UNLICENSED"}如果您不希望根据任何条款授予他人使用私有或未发布包的权利,则可以使用。
Please refer the full details here
请参阅此处的完整详细信息
So you might not get the error you mentioned.
所以你可能不会得到你提到的错误。
回答by brandonscript
According to the latest docs for package.json:
根据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.
如果您使用的许可证尚未分配 SPDX 标识符,或者您使用的是自定义许可证,请使用以下有效的 SPDX 表达式:
{ "license" : "SEE LICENSE IN <filename>" }然后包含一个
<filename>在包的顶层命名的文件。
回答by Carl Kidwell
Definitely DO NOT use the { "license": "UNLICENSED"}as suggested in the top voted answer if you wish to clearly communicate that you wish to have a copyright claim style license.
{ "license": "UNLICENSED"}如果您希望清楚地传达您希望拥有版权声明样式许可,绝对不要使用最高投票答案中的建议。
https://choosealicense.com/licenses/unlicense/
https://choosealicense.com/licenses/unlicense/
A clip from the first two paragraphs of the UNLICENSE license makes clear this has no relation at all to the OP's request to have a copyright claim:
来自 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.
这是发布到公共领域的免费且不受阻碍的软件。
任何人都可以出于任何商业或非商业目的,以任何方式自由复制、修改、发布、使用、编译、出售或分发本软件,无论是源代码形式还是编译后的二进制文件。
To the top voted answers credit the Node documentation page makes a claim that use of the UNLICENSED option is to make it so you are not granting any rights to others:
对于投票最高的答案,Node 文档页面声称使用 UNLICENSED 选项是为了使您不会向其他人授予任何权利:
if you do not wish to grant others the right to use a private or unpublished package under any terms:
如果您不希望根据任何条款授予他人使用私有或未发布包的权利:
This does not appear to be an actual safe choice to retain your rights - I'm not clear if this was a result of ignorance or bad intent. You could infer that the lack of the extra D means these are two entirely different terms - but you can not assume that others will know that and when they search for what the UNLICENSED license is they may get the link I found.
这似乎不是保留您权利的实际安全选择 - 我不清楚这是由于无知还是恶意。您可以推断缺少额外的 D 意味着这是两个完全不同的术语 - 但您不能假设其他人会知道这一点,并且当他们搜索 UNLICENSED 许可证是什么时,他们可能会得到我找到的链接。
{ "license" : "SEE LICENSE IN <filename>" }
Is the safer answer at this time.
是这个时候更安全的答案。
NOTE: I felt it was important to make this a top level answer, rather than a reply, as the top voted answer at this time has a large potential to be misinterpreted and this needs visibility.
注意:我认为将其作为顶级答案而不是回复很重要,因为此时投票最高的答案很可能被误解,这需要可见性。

