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/content/configuring-npm/install.md
+37-16
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,27 @@ description: Download and install node and npm
6
6
7
7
### Description
8
8
9
-
To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. **We strongly recommend using a Node version manager to install Node.js and npm.** We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.
9
+
To publish and install packages to and from the public npm registry, you
10
+
must install Node.js and the npm command line interface using either a Node
11
+
version manager or a Node installer. **We strongly recommend using a Node
12
+
version manager to install Node.js and npm.** We do not recommend using a
13
+
Node installer, since the Node installation process installs npm in a
14
+
directory with local permissions and can cause permissions errors when you
15
+
run npm packages globally.
10
16
11
17
### Overview
12
18
13
-
-[Checking your version of npm and Node.js](#checking-your-version-of-npm-and-node-js)
14
-
-[Using a Node version manager to install Node.js and npm](#using-a-node-version-manager-to-install-node-js-and-npm)
15
-
-[Using a Node installer to install Node.js and npm](#using-a-node-installer-to-install-node-js-and-npm)
To see if you already have Node.js and npm installed and check the installed version, run the following commands:
28
+
To see if you already have Node.js and npm installed and check the
29
+
installed version, run the following commands:
20
30
21
31
```
22
32
node -v
@@ -25,7 +35,10 @@ npm -v
25
35
26
36
### Using a Node version manager to install Node.js and npm
27
37
28
-
Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions.
38
+
Node version managers allow you to install and switch between multiple
39
+
versions of Node.js and npm on your system so you can test your
40
+
applications on multiple versions of npm to ensure they work for users on
41
+
different versions.
29
42
30
43
#### OSX or Linux Node version managers
31
44
@@ -39,28 +52,36 @@ Node version managers allow you to install and switch between multiple versions
39
52
40
53
### Using a Node installer to install Node.js and npm
41
54
42
-
If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system.
55
+
If you are unable to use a Node version manager, you can use a Node
56
+
installer to install both Node.js and npm on your system.
*[NodeSource installer](https://github.com/nodesource/distributions). If you use Linux, we recommend that you use a NodeSource installer.
59
+
*[NodeSource installer](https://github.com/nodesource/distributions). If
60
+
you use Linux, we recommend that you use a NodeSource installer.
46
61
47
62
#### OS X or Windows Node installers
48
63
49
-
If you're using OS X or Windows, use one of the installers from the [Node.js download page](https://nodejs.org/en/download/). Be sure to install the version labeled **LTS**. Other versions have not yet been tested with npm.
64
+
If you're using OS X or Windows, use one of the installers from the
65
+
[Node.js download page](https://nodejs.org/en/download/). Be sure to
66
+
install the version labeled **LTS**. Other versions have not yet been
67
+
tested with npm.
50
68
51
69
#### Linux or other operating systems Node installers
52
70
53
-
If you're using Linux or another operating system, use one of the following installers:
71
+
If you're using Linux or another operating system, use one of the following
Copy file name to clipboardExpand all lines: docs/content/configuring-npm/npmrc.md
+27-26
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,14 @@ description: The npm config files
6
6
7
7
### Description
8
8
9
-
npm gets its config settings from the command line, environment
10
-
variables, and `npmrc` files.
9
+
npm gets its config settings from the command line, environment variables,
10
+
and `npmrc` files.
11
11
12
-
The `npm config` command can be used to update and edit the contents
13
-
of the user and global npmrc files.
12
+
The `npm config` command can be used to update and edit the contents of the
13
+
user and global npmrc files.
14
14
15
-
For a list of available configuration options, see [config](/using-npm/config).
15
+
For a list of available configuration options, see
16
+
[config](/using-npm/config).
16
17
17
18
### Files
18
19
@@ -23,20 +24,19 @@ The four relevant files are:
23
24
* global config file ($PREFIX/etc/npmrc)
24
25
* npm builtin config file (/path/to/npm/npmrc)
25
26
26
-
All npm config files are an ini-formatted list of `key = value`
27
-
parameters. Environment variables can be replaced using
28
-
`${VARIABLE_NAME}`. For example:
27
+
All npm config files are an ini-formatted list of `key = value` parameters.
28
+
Environment variables can be replaced using`${VARIABLE_NAME}`. For
29
+
example:
29
30
30
31
```bash
31
32
prefix = ${HOME}/.npm-packages
32
33
```
33
34
34
-
Each of these files is loaded, and config options are resolved in
35
-
priority order. For example, a setting in the userconfig file would
36
-
override the setting in the globalconfig file.
35
+
Each of these files is loaded, and config options are resolved in priority
36
+
order. For example, a setting in the userconfig file would override the
37
+
setting in the globalconfig file.
37
38
38
-
Array values are specified by adding "[]" after the key name. For
39
-
example:
39
+
Array values are specified by adding "[]" after the key name. For example:
40
40
41
41
```bash
42
42
key[] = "first value"
@@ -45,7 +45,9 @@ key[] = "second value"
45
45
46
46
#### Comments
47
47
48
-
Lines in `.npmrc` files are interpreted as comments when they begin with a `;` or `#` character. `.npmrc` files are parsed by [npm/ini](https://github.com/npm/ini), which specifies this comment syntax.
48
+
Lines in `.npmrc` files are interpreted as comments when they begin with a
49
+
`;` or `#` character. `.npmrc` files are parsed by
50
+
[npm/ini](https://github.com/npm/ini), which specifies this comment syntax.
49
51
50
52
For example:
51
53
@@ -61,34 +63,33 @@ When working locally in a project, a `.npmrc` file in the root of the
61
63
project (ie, a sibling of `node_modules` and `package.json`) will set
62
64
config values specific to this project.
63
65
64
-
Note that this only applies to the root of the project that you're
65
-
running npm in. It has no effect when your module is published. For
66
-
example, you can't publish a module that forces itself to install
67
-
globally, or in a different location.
66
+
Note that this only applies to the root of the project that you're running
67
+
npm in. It has no effect when your module is published. For example, you
68
+
can't publish a module that forces itself to install globally, or in a
69
+
different location.
68
70
69
71
Additionally, this file is not read in global mode, such as when running
70
72
`npm install -g`.
71
73
72
74
#### Per-user config file
73
75
74
-
`$HOME/.npmrc` (or the `userconfig` param, if set in the environment
75
-
or on the command line)
76
+
`$HOME/.npmrc` (or the `userconfig` param, if set in the environment or on
77
+
the command line)
76
78
77
79
#### Global config file
78
80
79
-
`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above):
80
-
This file is an ini-file formatted list of `key = value` parameters.
81
-
Environment variables can be replaced as above.
81
+
`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above): This file
82
+
is an ini-file formatted list of `key = value` parameters. Environment
83
+
variables can be replaced as above.
82
84
83
85
#### Built-in config file
84
86
85
87
`path/to/npm/itself/npmrc`
86
88
87
89
This is an unchangeable "builtin" configuration file that npm keeps
88
90
consistent across updates. Set fields in here using the `./configure`
89
-
script that comes with npm. This is primarily for distribution
90
-
maintainers to override default configs in a standard and consistent
91
-
manner.
91
+
script that comes with npm. This is primarily for distribution maintainers
92
+
to override default configs in a standard and consistent manner.
0 commit comments