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/javascript/npm-package-management.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Manage npm packages for Node.js and ASP.NET Core projects
3
3
description: Manage packages in Visual Studio by using the Node.js package manager (npm) for both Node.js and ASP.NET Core applications.
4
-
ms.date: "2/11/2025"
4
+
ms.date: "6/15/2026"
5
5
ms.topic: "how-to"
6
6
ms.devlang: javascript
7
7
author: "mikejo5000"
@@ -16,30 +16,37 @@ dev_langs:
16
16
npm allows you to install and manage packages for use in both Node.js and ASP.NET Core applications. Visual Studio makes it easy to interact with npm and issue npm commands through the UI or directly. If you're unfamiliar with npm and want to learn more, go to the [npm documentation](https://docs.npmjs.com/).
17
17
18
18
Visual Studio integration with npm is different depending on your project type.
> npm expects the *node_modules* folder and *package.json* in the project root. If your app's folder structure is different, you should modify your folder structure if you want to manage npm packages using Visual Studio.
28
28
29
-
::: moniker range=">=vs-2022"
30
29
## CLI-based project (.esproj)
31
30
32
31
Starting in Visual Studio 2022, the npm package manager is available for [CLI-based projects](../javascript/javascript-in-vs-2022.md#project-templates), so you can now download npm modules similarly to the way you download NuGet packages for ASP.NET Core projects. Then you can use *package.json* to modify and delete packages.
33
32
34
33
To open the package manager, from Solution Explorer, right-click the **npm** node in your project and choose **Add npm package**.
35
34
36
-
:::image type="content" source="../javascript/media/vs-2022/npm-packages-open-manager-esproj.png" alt-text="Open package manager from Solution Explorer" border="true":::
35
+
::: moniker range="visualstudio"
36
+
:::image type="content" source="../javascript/media/visualstudio/npm-packages-open-manager-esproj.png" alt-text="Screenshot of opening package manager from Solution Explorer." border="true":::
37
+
::: moniker-end
38
+
::: moniker range="vs-2022"
39
+
:::image type="content" source="../javascript/media/vs-2022/npm-packages-open-manager-esproj.png" alt-text="Screenshot of opening package manager from Solution Explorer." border="true":::
40
+
::: moniker-end
37
41
38
42
Next, you can search for npm packages, select one, and install by selecting **Install Package**.
39
43
40
-
:::image type="content" source="../javascript/media/vs-2022/npm-packages-install-esproj.png" alt-text="Install new npm package for esproj" border="true":::
44
+
::: moniker range="visualstudio"
45
+
:::image type="content" source="../javascript/media/visualstudio/npm-packages-install-esproj.png" alt-text="Screenshot of installing new npm package for esproj." border="true":::
46
+
::: moniker-end
47
+
::: moniker range="vs-2022"
48
+
:::image type="content" source="../javascript/media/vs-2022/npm-packages-install-esproj.png" alt-text="Screenshot of installing new npm package for esproj." border="true":::
41
49
::: moniker-end
42
-
43
50
44
51
## ASP.NET Core projects
45
52
@@ -56,8 +63,8 @@ If your project does not already include a *package.json* file, you can add one
0 commit comments