關於npm audit fix

https://blog.csdn.net/weixin_40817115/article/details/81007774node

 

npm audit : npm@5.10.0 & npm@6,容許開發人員分析複雜的代碼,並查明特定的漏洞和缺陷。npm

npm audit fix :npm@6.1.0,  檢測項目依賴中的漏洞並自動安裝須要更新的有漏洞的依賴,而沒必要再本身進行跟蹤和修復。json

同時,官網中還提供了一些其餘的命令,整理以下:.net

1. 運行audit fix,可是隻更新pkglock, 不更新node_modules:blog

$ npm audit fix --package-lock-only
2. 只更新dependencies中安裝的包,跳過devDependencies中的包:ci

$ npm audit fix --only=prod
3.運行命令,獲得audit fix將會更新的內容,而且輸出json格式的安裝信息,可是並不真的安裝更新:開發

$ npm audit fix --dry-run --json
4. 獲得json格式的詳細檢測報告it

$ npm audit --json
附:module

npm-audit 官網地址:https://docs.npmjs.com/cli/audit
---------------------
做者:奮鬥的小綠蘿
來源:CSDN
原文:https://blog.csdn.net/weixin_40817115/article/details/81007774
版權聲明:本文爲博主原創文章,轉載請附上博文連接!cli

相關文章
相關標籤/搜索