← Back to Node.js Course | Chapter 3: npm & Packages | Lesson 4 of 7

npx क्या है

npx permanently install किए बिना एक package का command चलाता है।

In this page:

  1. npx
Syntax
javascript
npx package_name arguments

npx

npx temporarily एक package download करता है (या एक local वाला इस्तेमाल करता है) और इसका binary चलाता है। यह create-react-app जैसे scaffolding tools या one-off tasks के लिए ideal है। node_modules/.bin में local binaries भी npx से मिलते हैं।

Note: आप जो version चलाते हैं उसे pin करने के लिए npx package@version इस्तेमाल करें।

उदाहरण: npx

bash
$ npx cowsay "Hello npx"
$ npx eslint .
$ npx create-vite@latest my-app
$ npx --yes serve .

⚠️ Run this in your own terminal or Node.js environment.

Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. यह मान लेना कि npx globally install करता है
  2. untrusted packages blindly चलाना
  3. यह भूल जाना कि version runs के बीच बदल सकता है
चैप्टर सारांश
  • npx package binaries चलाता है
  • कोई permanent install चाहिए नहीं
  • Local node_modules/.bin tools ढूंढता है
  • Repeatability के लिए versions pin करें
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.