You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/cli/v10/commands/npm-ls.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
36
36
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
Copy file name to clipboardExpand all lines: content/cli/v11/commands/npm-ls.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
52
52
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
-[`a9d242b`](https://github.com/npm/cli/commit/a9d242bc4f04440630141743949ddb0d323f90b4)[#9099](https://github.com/npm/cli/pull/9099) include all subcommands on main command help (#9099) (@wraithgar)
23
+
-[`29b8407`](https://github.com/npm/cli/commit/29b8407971af1b9a2a3dcdb3849adfa04363fa7f)[#9087](https://github.com/npm/cli/pull/9087) unwrap comments and lines meant for output (#9087) (@wraithgar)
-[`76c76e5`](https://github.com/npm/cli/commit/76c76e5ad7cc5c7f641a92334b900c9d0c9a3fbd)[#9083](https://github.com/npm/cli/pull/9083) ci: don't error on optional deps in the lockfile (#9083) (@wraithgar)
26
+
-[`a29aeee`](https://github.com/npm/cli/commit/a29aeee18f3ddc2348a8e00787d237c874642789)[#9028](https://github.com/npm/cli/pull/9028) arborist: retry bin-links on Windows EPERM (#9028) (@manzoorwanijk)
27
+
-[`6565eeb`](https://github.com/npm/cli/commit/6565eeb818494e1feb4e14492804ce936b394b4a)[#9045](https://github.com/npm/cli/pull/9045) bypass packument cache to prevent ETARGET errors after publish (#9045) (@Jadu07)
28
+
29
+
### Documentation
30
+
31
+
-[`3b96929`](https://github.com/npm/cli/commit/3b96929166a55f7f0c346f9715988ec1e1ce195d)[#9074](https://github.com/npm/cli/pull/9074) scripts: remove mention of obsolete root user behavior (#9074) (@mohd-akram)
-[`d1996a7`](https://github.com/npm/cli/commit/d1996a7a79982f616600d134dbdcfb223cd0d81d)[#9060](https://github.com/npm/cli/pull/9060) dev dependency updates (@wraithgar)
-[Discussion about script working directory reliability in npm v6 and earlier](https://github.com/npm/npm/issues/12356)
237
237
238
-
### User
239
-
240
-
When npm is run as root, scripts are always run with the effective uid and gid of the working directory owner.
241
-
242
238
### Environment
243
239
244
240
Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state of the process.
Copy file name to clipboardExpand all lines: content/cli/v11/using-npm/workspaces.mdx
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,24 +95,22 @@ npm install abbrev -w a
95
95
96
96
**Adding a workspace as a dependency of another workspace:**
97
97
98
-
If you want to add workspace **b** as a dependency of workspace **a**, you can use the workspace protocol in the dependency specifier:
98
+
The same approach works when adding one workspace as a dependency of another. If you want to add workspace **b** as a dependency of workspace **a**, run:
99
99
100
100
```
101
-
npm install b@workspace:* -w a
101
+
npm install b -w a
102
102
```
103
103
104
-
This will add an entry to workspace **a**'s `package.json`like:
104
+
npm will detect that **b** is a workspace and automatically symlink it rather than fetching it from the registry. The resulting entry in workspace **a**'s `package.json`will use a standard version range:
105
105
106
106
```json
107
107
{
108
108
"dependencies": {
109
-
"b": "workspace:*"
109
+
"b": "^1.0.0"
110
110
}
111
111
}
112
112
```
113
113
114
-
The `workspace:` protocol tells npm to link to the local workspace rather than fetching from the registry. The `*` version means it will use whatever version is defined in workspace **b**'s `package.json`.
115
-
116
114
Note: other installing commands such as `uninstall`, `ci`, etc will also respect the provided `workspace` configuration.
0 commit comments