最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

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

ReactJS crifan 6920浏览 0评论

reactjs项目中,去:

npm install

结果警告:

npm WARN [email protected] license should be a valid SPDX license expression

➜  ReactjsTemplate git:(master) ✗ npm install
> [email protected] 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
> [email protected] 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 [email protected] 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.187 seconds, using 22.14MB memory