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: docs/lib/content/commands/npm-access.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,7 @@ Used to set access controls on private packages.
15
15
For all of the subcommands, `npm access` will perform actions on the packages in the current working directory if no package name is passed to the subcommand.
16
16
17
17
* grant / revoke:
18
-
Add or remove the ability of users and teams to have read-only or read-write
19
-
access to a package.
18
+
Add or remove the ability of users and teams to have read-only or read-write access to a package.
20
19
21
20
### Details
22
21
@@ -30,8 +29,7 @@ You must have privileges to set the access of a package:
30
29
31
30
* You are an owner of an unscoped or scoped package.
32
31
* You are a member of the team that owns a scope.
33
-
* You have been given read-write privileges for a package, either as a member
34
-
of a team or directly as an owner.
32
+
* You have been given read-write privileges for a package, either as a member of a team or directly as an owner.
35
33
36
34
If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on the command line.
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-audit.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,8 +145,7 @@ If remediations do not require changes to the dependency ranges, then all vulner
145
145
The `npm audit` command will exit with a 0 exit code if no vulnerabilities were found.
146
146
The `npm audit fix` command will exit with 0 exit code if no vulnerabilities are found _or_ if the remediation is able to successfully fix all vulnerabilities.
147
147
148
-
If vulnerabilities were found the exit code will depend on the
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-ci.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,20 @@ description: Clean install a project
10
10
11
11
### Description
12
12
13
-
This command is similar to [`npm install`](/commands/npm-install), except it's meant to be used in automated environments such as test platforms,
14
-
continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies.
13
+
This command is similar to [`npm install`](/commands/npm-install), except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies.
15
14
16
15
The main differences between using `npm install` and `npm ci` are:
17
16
18
17
* The project **must** have an existing `package-lock.json` or
19
18
`npm-shrinkwrap.json`.
20
19
* If dependencies in the package lock do not match those in `package.json`,
21
20
`npm ci` will exit with an error, instead of updating the package lock.
22
-
*`npm ci` can only install entire projects at a time: individual
23
-
dependencies cannot be added with this command.
24
-
* If a `node_modules` is already present, it will be automatically removed
25
-
before `npm ci` begins its install.
21
+
*`npm ci` can only install entire projects at a time: individual dependencies cannot be added with this command.
22
+
* If a `node_modules` is already present, it will be automatically removed before `npm ci` begins its install.
26
23
* It will never write to `package.json` or any of the package-locks:
27
24
installs are essentially frozen.
28
25
29
-
NOTE: If you create your `package-lock.json` file by running `npm install`
30
-
with flags that can affect the shape of your dependency tree, such as
26
+
NOTE: If you create your `package-lock.json` file by running `npm install` with flags that can affect the shape of your dependency tree, such as
31
27
`--legacy-peer-deps` or `--install-links`, you _must_ provide the same flags to `npm ci` or you are likely to encounter errors.
32
28
An easy way to do this is to run, for example,
33
29
`npm config set legacy-peer-deps=true --location=project` and commit the
because npm favors updates by default, even when doing so causes duplication.
47
+
Though `d`'s dependency on `[email protected]` could have been satisfied by `[email protected]`, the newer `[email protected]` dependency was used, because npm favors updates by default, even when doing so causes duplication.
49
48
50
49
Running `npm dedupe` will cause npm to note the duplication and re-evaluate, deleting the nested `c` module, because the one in the root is sufficient.
This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the [`--browser` config](/using-npm/config#browser) param.
15
14
You can pass multiple package names at once.
16
15
If no package name is provided, it will search for a `package.json` in the current folder and use the `name` property.
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-doctor.md
+9-18Lines changed: 9 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,12 @@ description: Check the health of your npm environment
14
14
npm is mostly a standalone tool, but it does have some basic requirements that must be met:
15
15
16
16
+ Node.js and git must be executable by npm.
17
-
+ The primary npm registry, `registry.npmjs.com`, or another service that
18
-
uses the registry API, is available.
19
-
+ The directories that npm uses, `node_modules` (both locally and
20
-
globally), exist and can be written by the current user.
17
+
+ The primary npm registry, `registry.npmjs.com`, or another service that uses the registry API, is available.
18
+
+ The directories that npm uses, `node_modules` (both locally and globally), exist and can be written by the current user.
21
19
+ The npm cache exists, and the package tarballs within it aren't corrupt.
22
20
23
21
Without all of these working properly, npm may not work properly.
24
-
Many issues are often attributable to things that are outside npm's code base,
25
-
so `npm doctor` confirms that the npm installation is in a good state.
22
+
Many issues are often attributable to things that are outside npm's code base, so `npm doctor` confirms that the npm installation is in a good state.
26
23
27
24
Also, in addition to this, there are also very many issue reports due to using old versions of npm.
28
25
Since npm is constantly improving, running `npm@latest` is better than an old version.
@@ -37,11 +34,9 @@ By default, npm installs from the primary npm registry,
37
34
`registry.npmjs.org`.
38
35
`npm doctor` hits a special connection testing endpoint within the registry.
39
36
This can also be checked with `npm ping`.
40
-
If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over
41
-
HTTPS to `registry.npmjs.org`.
37
+
If this check fails, you may be using a proxy that needs to be configured, or may need to talk to your IT staff to get access over HTTPS to `registry.npmjs.org`.
42
38
43
-
This check is done against whichever registry you've configured (you can see what that is by running `npm config get registry`), and if you're using
44
-
a private registry that doesn't support the `/whoami` endpoint supported by the primary registry, this check may fail.
39
+
This check is done against whichever registry you've configured (you can see what that is by running `npm config get registry`), and if you're using a private registry that doesn't support the `/whoami` endpoint supported by the primary registry, this check may fail.
45
40
46
41
#### `Checking npm version`
47
42
@@ -52,8 +47,7 @@ The team believes that the latest tested version of npm is almost always likely
52
47
#### `Checking node version`
53
48
54
49
For most users, in most circumstances, the best version of Node will be the latest long-term support (LTS) release.
55
-
Those of you who want access to new
56
-
ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies.
50
+
Those of you who want access to new ECMAscript features or bleeding-edge changes to Node's standard library may be running a newer version, and some may be required to run an older version of Node because of enterprise change control policies.
57
51
That's OK!
58
52
But in general, the npm team recommends that most users run Node.js LTS.
59
53
@@ -66,18 +60,15 @@ This part of `npm doctor` just lets you, and maybe whoever's helping you with su
66
60
67
61
#### `Checking for git executable in PATH`
68
62
69
-
While it's documented in the README, it may not be obvious that npm needs
70
-
Git installed to do many of the things that it does.
71
-
Also, in some cases
72
-
– especially on Windows – you may have Git set up in such a way that it's not accessible via your `PATH` so that npm can find it.
63
+
While it's documented in the README, it may not be obvious that npm needs Git installed to do many of the things that it does.
64
+
Also, in some cases – especially on Windows – you may have Git set up in such a way that it's not accessible via your `PATH` so that npm can find it.
73
65
This check ensures that Git is available.
74
66
75
67
#### Permissions checks
76
68
77
69
* Your cache must be readable and writable by the user running npm.
78
70
* Global package binaries must be writable by the user running npm.
79
-
* Your local `node_modules` path, if you're running `npm doctor` with a
80
-
project directory, must be readable and writable by the user running npm.
71
+
* Your local `node_modules` path, if you're running `npm doctor` with a project directory, must be readable and writable by the user running npm.
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-edit.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,7 @@ description: Edit an installed package
10
10
11
11
### Description
12
12
13
-
Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm `editor`
14
-
config -- see [`npm-config`](npm-config).)
13
+
Selects a dependency in the current project and opens the package folder in the default editor (or whatever you've configured as the npm `editor` config -- see [`npm-config`](npm-config).)
15
14
16
15
After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.
Copy file name to clipboardExpand all lines: docs/lib/content/commands/npm-fund.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,7 @@ description: Retrieve funding information
12
12
13
13
This command retrieves information on how to fund the dependencies of a given project.
14
14
If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit.
15
-
If a package name is provided then it tries to open its funding url using the
16
-
[`--browser` config](/using-npm/config#browser) param; if there are multiple funding sources for the package, the user will be instructed to pass the
15
+
If a package name is provided then it tries to open its funding url using the [`--browser` config](/using-npm/config#browser) param; if there are multiple funding sources for the package, the user will be instructed to pass the
17
16
`--which` option to disambiguate.
18
17
19
18
The list will avoid duplicated entries and will stack all packages that share the same url as a single entry.
@@ -23,8 +22,7 @@ Thus, the list does not have the same shape of the output from `npm ls`.
23
22
24
23
### Workspaces support
25
24
26
-
It's possible to filter the results to only include a single workspace and its dependencies using the
It's possible to filter the results to only include a single workspace and its dependencies using the [`workspace` config](/using-npm/config#workspace) option.
0 commit comments