TGViewer
Web Development Web Development @web_dev_bds · 4.44K subscribers
Post #954 491
npm or npx?

The two commands differ by one letter. Their jobs couldn't be more different.

👉 npm installs packages into your project.
👉 npx downloads a package, runs it, and removes it afterward unless it's already available.

That's why you'll see this:
npx create-vite@latest

instead of:
npm install create-vite


You're only using create-vite once to generate a project. Keeping it installed afterward serves no purpose.

📖 A simple rule works almost every time:
✔️ If your application needs it to run, install it.
✔️ If you only need the tool for a one-time task, run it with npx.
  • ❤ 3
More from @web_dev_bds
  1. Oct 11, 2026CSS Tip Stop centring tooltips with 𝚝𝚛𝚊𝚗𝚜𝚕𝚊𝚝𝚎: -𝟻𝟶%. near the edge of the scree…
  2. Oct 9, 2026JavaScript CheatSheet
  3. Oct 8, 2026📕Pro tip if you're using Postgres: Set `application_name` in your app's DB connector/ORM/…
  4. Oct 7, 2026🚀 Beginner → Developer: What to Learn in 6 Months Want to become job-ready but don't know…
  5. Oct 6, 2026React vs Angular
  6. Oct 5, 2026Post #1048
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →