Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docs for npm install <folder> #4428

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions docs/content/commands/npm-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,20 @@ into a tarball (b).

* `npm install <folder>`:

Install the package in the directory as a symlink in the current
project. Its dependencies will be installed before it's linked. If
`<folder>` sits inside the root of your project, its dependencies may
If `<folder>` sits inside the root of your project, its dependencies will be installed and may
be hoisted to the top-level `node_modules` as they would for other
types of dependencies.
types of dependencies. If `<folder>` sits outside the root of your project,
*npm will not install the package dependencies* in the directory `<folder>`,
but it will create a symlink to `<folder>`.

> NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use [`npm pack`](/commands/npm-pack) while in the `<folder>` directory, and then install the resulting tarball instead of the `<folder>` using `npm install <tarball file>`

Example:

```bash
npm install ../../other-package
npm install ./sub-package
```

* `npm install <tarball file>`:

Expand Down