mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-30 04:30:01 +02:00
Add npm install docs (#2006)
* Update 101-global-install-vs-local-install.md * Update content/roadmaps/107-nodejs/content/102-nodejs-npm/101-global-install-vs-local-install.md Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
This commit is contained in:
@@ -1 +1,9 @@
|
||||
# Global install vs local install
|
||||
# Global Install vs Local Install
|
||||
|
||||
NodeJS and NPM allow two methods of installing dependencies/packages: Local and Global. This is mainly used when adding a package or dependency as part of a specific project you're working on. The package would be installed (with its dependencies) in `node_modules` folder **under your project**. In addition, in `package.json` file there will be a new line added for the installed dependency under the label `dependencies`.
|
||||
At this point - you can start using the package in your NodeJS code by importing the package.
|
||||
|
||||
Unlike the local install, you can install packages and dependencies **globally**. This would install it in a system path, and these packages would be available to any program which runs on **this specific** computer. This method is often used for installing command line tools (for example, even `npm` program is a Globally installed npm package).
|
||||
|
||||
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
|
||||
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://docs.npmjs.com/cli/v8/commands/npm-install'>NPM Install Docs</BadgeLink>
|
||||
|
Reference in New Issue
Block a user