GitHub 代码仓库提示:“We found a potential security vulnerability in one of your dependencies”

Posted sallyshan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GitHub 代码仓库提示:“We found a potential security vulnerability in one of your dependencies”相关的知识,希望对你有一定的参考价值。

github代码仓库提示:“We found a potential security vulnerability in one of your dependencies”

问题描述:

Github上传代码后出现这样的错误:
We found a potential security vulnerability in one of your dependencies.
A dependency defined in ./package-lock.json has known security vulnerabilities
and should be updated.

 
技术图片

解决方案:

  • 首先删除package-lock.json 并同步到git,保证git上面没有lock这个文件,不会出警报;
  • 然后在本地文件夹把package-lock.json 还原回来
    找到一个叫做 .gitignore,把package-lock.json贴在这个文件里。(这个文件是专门填写 需要git忽略掉的文件名字的)
  • 再次同步到git,这个时候就会发现,package-lock.json还是在本地文件夹里,但是不在git上,所以也就不会报错了。
  • 不明白的话,可以看看这个人的.gitignore 怎么写的
    https://github.com/yezihaohao/react-admin

注明:此文为转载文章

作者:云社区用户回答
来源:腾讯云问答
原文:https://cloud.tencent.com/developer/ask/128169

以上是关于GitHub 代码仓库提示:“We found a potential security vulnerability in one of your dependencies”的主要内容,如果未能解决你的问题,请参考以下文章

Github&&SourceTree

如何将本地代码提交到github远程仓库

01在 Github 上编辑代码

IDEA使用总结1-Github下载代码和上传代码到Git

Git 技术篇 - 同步代码到github失败,提示non-fast-forwarderror: failed to push some refs to问题解决方法,git pull的用法

关于代码覆盖 or 冲突