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/artifacts/npm/npmrc.md
+38-17Lines changed: 38 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ The following steps guide you through setting up the project-level configuration
47
47
48
48
1. Select **Connect to Feed** and then select **npm** from the left navigation pane.
49
49
50
-
1. Add a *.npmrc* to your project, in the same directory as your *package.json* and paste the provided snippet from the **Project setup** into the file.
50
+
1. Add a *.npmrc* to your project, in the same directory as your *package.json* and paste the provided snippet from the **Project setup**section into the file.
51
51
52
52
:::image type="content" source="../media/npm-project-setup-azure-devops.png" alt-text="A screenshot displaying how to set up your npm project and connect to a feed.":::
53
53
@@ -59,7 +59,15 @@ The following steps guide you through setting up the project-level configuration
59
59
60
60
### [Other](#tab/other/)
61
61
62
-
1. Add a *.npmrc* file in your project's directory, in the same directory as your *package.json* file, and paste the following snippet into it.
62
+
1. Sign in to your Azure DevOps organization, and then navigate to your project.
63
+
64
+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
65
+
66
+
1. Select **Connect to Feed** and then select **npm** from the left navigation pane.
67
+
68
+
1. Add a *.npmrc* file to your project's directory. This should be the same directory where your *package.json* file is located.
69
+
70
+
1. Paste the snippet provided in the **Project setup** section into your *.npmrc* file. Your file should look similar to the following:
@@ -99,19 +107,19 @@ The following steps guide you through setting up the project-level configuration
99
107
100
108
1. Generate a [personal access token](../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) with **packaging read and write** scopes.
101
109
102
-
1. Run the following command in a command prompt window, and then paste your personal access token when prompted. Once done, copy the generated Base 64 encoded value.
110
+
1. Run the following command in a command prompt window. When prompted, paste your personal access token (PAT) and press **Enter**. The script will return a Base64-encoded version of your PAT, copy that value to use in the next step.
1. If you're on Linux/Mac, you can alternatively use the following command to convert your personal access token to Base 64. Copy the resulting Base64 encoded value.
116
+
1. If you're using Linux or macOS, you can run the following command in your terminal to convert your personal access token (PAT) to a Base64-encoded string. Copy the resulting value to use in the next step.
109
117
110
118
```
111
119
echo -n "YOUR_PERSONAL_ACCESS-TOKEN" | base64
112
120
```
113
121
114
-
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user *.npmrc* file with the encoded personal access token obtained from the previous step.
122
+
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user-level *.npmrc* file with the Base64-encoded personal access token you generated in the previous step.
115
123
116
124
* * *
117
125
@@ -123,23 +131,30 @@ The following steps guide you through setting up the project-level configuration
123
131
124
132
1. Sign in to your Azure DevOps collection, and then navigate to your project.
125
133
126
-
1. Select **Artifacts**, and then select **Connect to Feed**.
134
+
1. Select **Artifacts**, select your feed from the dropdown menu, and then select **Connect to Feed**.
127
135
128
136
:::image type="content" source="../media/server-2022-1-connect-to-feed.png" alt-text="A screenshot showing how to connect to a feed in Azure DevOps Server 2022.1.":::
129
137
130
-
1. Select **npm** from the left sidebar, and then follow the instructions in the **Project setup** section to set up your config file.
138
+
1. Select **npm** from the left, and then follow the steps in the **Project setup** section to configure your .npmrc. file and authenticate with your feed.
131
139
132
140
:::image type="content" source="../media/npm-project-setup-server-2022-1.png" alt-text="A screenshot showing how to set up your npm project in Azure DevOps Server 2022.1.":::
133
141
134
-
### [Linux/macOS](#tab/Linuxmac/)
142
+
### [Other](#tab/other/)
143
+
144
+
1. Sign in to your Azure DevOps collection, and then navigate to your project.
145
+
146
+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
147
+
148
+
1. Select **Connect to Feed** and then select **npm** from the left navigation pane.
135
149
136
-
1. Add a *.npmrc* file in your project's directory, in the same directory as your *package.json* file, and paste the following snippet into it.
150
+
1. Add a *.npmrc* file in your project's directory, in the same directory as your *package.json* file, and paste the snippet provided in the **Project setup** section into your *.npmrc* file. Your file should look similar to the following:
1. Copy the following snippet and paste it into your user-level *.npmrc* file:
@@ -172,13 +187,13 @@ The following steps guide you through setting up the project-level configuration
172
187
173
188
1. Generate a [personal access token](../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) with **packaging read and write** scopes.
174
189
175
-
1. Run the following command in a command prompt window, and then paste your personal access token when prompted. Once done, copy the generated Base 64 encoded value.
190
+
1. Run the following command in a command prompt window. When prompted, paste your personal access token and press **Enter**. The script will return a Base64-encoded version of your PAT, copy that value to use in the next step.
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user *.npmrc* file with the encoded personal access token obtained from the previous step.
196
+
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user-level *.npmrc* file with the Base64-encoded personal access token you generated in the previous step.
182
197
183
198
* * *
184
199
@@ -194,13 +209,19 @@ The following steps guide you through setting up the project-level configuration
194
209
195
210
:::image type="content" source="../media/server-2020-1-connect-to-feed.png" alt-text="A screenshot showing how to connect to a feed in Azure DevOps Server 2020.1.":::
196
211
197
-
1. Select **npm** from the left, and then follow the instructions in **Project setup** to set up your config file.
212
+
1. Select **npm** from the left, and then follow the steps in the **Project setup** section to configure your .npmrc. file and authenticate with your feed.
198
213
199
214
:::image type="content" source="../media/npm-project-setup-server-2020-1.png" alt-text="A screenshot showing how to set up your npm project in Azure DevOps Server 2020.1.":::
200
215
201
-
### [Linux/macOS](#tab/Linuxmac/)
216
+
### [Other](#tab/other/)
217
+
218
+
1. Sign in to your Azure DevOps collection, and then navigate to your project.
219
+
220
+
1. Select **Artifacts**, and then select your feed from the dropdown menu.
221
+
222
+
1. Select **Connect to Feed** and then select **npm** from the left navigation pane.
202
223
203
-
1. Add a *.npmrc* file in your project's directory, in the same directory as your package.json file, and paste the following snippet into it:
224
+
1. Add a *.npmrc* file in your project's directory, in the same directory as your *package.json* file, and paste the snippet provided in the **Project setup** section into your *.npmrc* file. Your file should look similar to the following:
@@ -243,20 +264,20 @@ The following steps guide you through setting up the project-level configuration
243
264
244
265
1. Generate a [personal access token](../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) with **packaging read and write** scopes.
245
266
246
-
1. Run the following command in a command prompt window, and then paste your personal access token when prompted. Once done, copy the generated Base 64 encoded value.
267
+
1. Run the following command in a command prompt window. When prompted, paste your personal access token and press **Enter**. The script will return a Base64-encoded version of your PAT, copy that value to use in the next step.
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user *.npmrc* file with the encoded personal access token obtained from the previous step.
273
+
1. Replace the placeholders *[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]* in your user-level *.npmrc* file with the Base64-encoded personal access token you generated in the previous step.
253
274
254
275
* * *
255
276
256
277
::: moniker-end
257
278
258
279
> [!TIP]
259
-
> Using multiple registries in .npmrc files is supported with [scopes](..//npm/scopes.md) and [upstream sources](../concepts/upstream-sources.md).
280
+
> Using multiple registries in *.npmrc* files is supported with [scopes](..//npm/scopes.md) and [upstream sources](../concepts/upstream-sources.md).
0 commit comments