पाठ 8 / 28

पैकेज इंस्टॉल करना

npm install, डिपेंडेंसी के प्रकार, और लॉकफ़ाइल।

npm install

एक रनटाइम डिपेंडेंसी, केवल-डेव टूल जोड़ें, या मौजूदा package.json से सब कुछ इंस्टॉल करें।

npm install express          # runtime dependency
npm install -D nodemon       # devDependency
npm install                  # install everything from package.json

node_modules और लॉकफ़ाइल

पैकेज node_modules/ में जाते हैं। package-lock.json सटीक वर्ज़न तय करता है ताकि हर इंस्टॉल एक जैसा हो — इसे कमिट करें।