npm audit

पैकेज और रनटाइम

इस्तेमाल

npm audit [fix] [--audit-level=<level>]

स्थापित पेड़ में ज्ञात कमज़ोरियाँ बताता है; fix --force ऐसे major संस्करण ले आता है जो चीज़ें तोड़ देते हैं, और dev-only गहरी dependency की चेतावनियाँ अक्सर ठीक ही नहीं हो पातीं।

आम विकल्प

विकल्पअर्थ
fixupgrade what it can inside your version ranges
fix --forceallow breaking major upgrades to clear a report
--audit-level=highonly fail on high and above
--omit=devignore dev-only dependencies
--jsonmachine-readable report
--dry-runshow the plan without changing anything

उदाहरण

npm audit

lists known vulnerabilities in the installed tree

npm audit fix

upgrades the ones that fit your ranges

npm audit fix --force

may install major versions that break your build

सवाल हमेशा यही है कि क्या कहाँ जाए: इस प्रोजेक्ट के भीतर, या पूरी मशीन पर।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. npm audit क्या करता है?

स्थापित पेड़ में ज्ञात कमज़ोरियाँ बताता है; fix --force ऐसे major संस्करण ले आता है जो चीज़ें तोड़ देते हैं, और dev-only गहरी dependency की चेतावनियाँ अक्सर ठीक ही नहीं हो पातीं।

Q. इसे कैसे लिखें?

npm audit [fix] [--audit-level=<level>] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 6 दिए हैं; पूरी सूची man npm में है। यह कमांड पैकेज और रनटाइम में आती है।

मिलती-जुलती कमांड

man पेज: man npm-audit