最新消息:20210917 已从crifan.com换到crifan.org

【已解决】ReactJS中npm install警告:npm WARN license should be a valid SPDX license expression

ReactJS crifan 5308浏览 0评论

reactjs项目中,去:

npm install

结果警告:

npm WARN project-name@0.0.1 license should be a valid SPDX license expression

➜  ReactjsTemplate git:(master) ✗ npm install
> fsevents@1.1.2 install /Users/crifan/dev/dev_root/crifan/ReactjsTemplate/ReactjsTemplate/node_modules/fsevents
> node install
[fsevents] Success: “/Users/crifan/dev/dev_root/crifan/ReactjsTemplate/ReactjsTemplate/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node” already installed
Pass –update-binary to reinstall or –build-from-source to recompile
> uglifyjs-webpack-plugin@0.4.6 postinstall /Users/crifan/dev/dev_root/crifan/ReactjsTemplate/ReactjsTemplate/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN project-name@0.0.1 license should be a valid SPDX license expression

搜:

should be a valid SPDX license expression

参考:

what SPDX license should I use for private modules? · Issue #8773 · npm/npm

直接设置为:

UNLICENSED

不合适啊。

此处

package.json

中写的是:

“license”: “GNU v3”,

此处希望:

把我本地的LICENSE的GNU v3

写进去

How to support proprietary licenses in package.json without triggering an NPM warning? · Issue #8795 · npm/npm

‘SEE LICENSE IN’ and ‘UNLICENSED’ now banned, and no SPDX license for proprietary software. · Issue #8918 · npm/npm

SPDX License List | Software Package Data Exchange (SPDX)

试试:

LicenseRef-LICENSE

结果问题依旧。

貌似是:

GNU General Public License v3.0 only

的:

GPL-3.0

【总结】

改为:

“license”: “GPL-3.0”,

然后就可以了:

其中:GPL-3.0

对应着:

GNU General Public License v3.0 only

其他的值,详见:

SPDX License List | Software Package Data Exchange (SPDX)

https://spdx.org/licenses/

转载请注明:在路上 » 【已解决】ReactJS中npm install警告:npm WARN license should be a valid SPDX license expression

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
99 queries in 0.218 seconds, using 23.36MB memory