node --version
पैकेज और रनटाइम
इस्तेमाल
node --version | node -vPATH में सबसे पहले मिलने वाले node का संस्करण छापता है; इसीलिए version manager होने पर editor का terminal या CI job दूसरा संस्करण बता सकता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -v | the same thing, shorter; prints e.g. v22.14.0 |
| -p <expr> | print one expression, e.g. node -p process.versions.v8 |
| -e <code> | run a line of code with no file |
| --env-file=<file> | load a .env before running, from node 20.6 |
| --help | every flag this build accepts |
उदाहरण
node --versionthe version of the node first on your PATH
node -p process.execPathwhich binary that actually is, when several are installed
node -p process.versions.v8the V8 version bundled with it
सवाल हमेशा यही है कि क्या कहाँ जाए: इस प्रोजेक्ट के भीतर, या पूरी मशीन पर।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. node --version क्या करता है?
PATH में सबसे पहले मिलने वाले node का संस्करण छापता है; इसीलिए version manager होने पर editor का terminal या CI job दूसरा संस्करण बता सकता है।
Q. इसे कैसे लिखें?
node --version | node -v — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 5 दिए हैं; पूरी सूची man node में है। यह कमांड पैकेज और रनटाइम में आती है।
मिलती-जुलती कमांड
man पेज: man node---version