问题
npm在安装小程序wepy框架的时候会出现一个found 1 high severity vulnerability提醒
1.案例
我们按照官网的安装步骤来(原谅我根本不明白漏洞原因)
$ npm install @wepy/cli -g # 全局安装 WePY CLI 工具
$ wepy init standard myproj # 使用 standard 模板初始化项目
$ cd myproj # 进入到项目目录
$ npm install # 安装项目依赖包 ----> 问题出现在第三步
$ npm run dev # 监听并且编译项目
+ @wepy/cli@2.1.0
added 487 packages from 384 contributors and audited 488 packages in 72.864s
11 packages are looking for funding
run `npm fund` for details
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
2.解决
npm官网提供了命令说明,比如有幸查过一次
npm audit fix //检测项目依赖中的漏洞并自动安装需要更新的有漏洞的依赖,无需自己跟踪和修复。
npm audit //允许开发者分析复杂的代码,并查看漏洞和缺陷。
所以我只需要按照提示 npm audit fix
26 packages are looking for funding
run `npm fund` for details
fixed 0 of 1 vulnerability in 774 scanned packages
1 vulnerability required manual review and could not be updated
总结
官网还是完全靠谱的呀!!!
一名新手程序猿(QAQ),不懂就查,查不到就问,问不到就…去工地搬砖?