Mid
From PDF
Node.js
Node.js
How do you install a package globally vs locally?
Local Installation (default):
Installs the package into the node_modules folder of your current project.
npm install lodash
- ✅ Used when the package is needed as part of your app's code.
Global Installation:
Installs the package system-wide, making it available in the command line anywhere.
npm install -g nodemon
- ✅ Used for tools/CLI apps like nodemon, eslint, typescript, etc.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png