Visual Studio 2017 does not restore packages when saving

In VS2017 I have a quick hello world node.js project. The installed template for node.js includes the use of NPM using the included package.json . I am editing a package.json file to include new dependencies. When saving package.json VS should install any new packages that are included.

I started with the project template: Other languages ​​\ TypeScript \ Node.js Project Template: Empty node.js Web Application

I confirmed that the option is enabled to restore npm packages while saving package.json

Tools \ Options \ Projects and Solutions \ Web Package Management \ Package Recovery

But no matter what changes I made to package.json VS, npm will not start and install the missing packages. Also, if I build or run VS, it will not automatically install the missing packages. I can right click on npm and select Install Missing Packages, which works.

What am I missing?

enter image description here

+7
npm visual-studio-2017
source share
2 answers

Restore Save packages for NPM packages currently does not work in NPM projects. I still keep track of the root of the problem, but I came across a discussion where they (NTVS people) wanted to give up some kinds of behavior for web projects.

There are some context menu options on npm or individual package nodes for recovery / update / etc. You can also create new keyboard shortcuts for these context menu items, but I don’t know how to make Ctrl + S work .

I follow the internal document to review these decisions, but at the same time send feedback so that we provide some customer data!

+3
source share

As mentioned here . package.json no longer required .

Links to packages in project files:

Package links using the PackageReference node allow you to manage NuGet dependencies directly in the .NET Core project files, without requiring a separate package.config or project.json file. This approach also allows you to use the MSBuild conditions to select package links for the target structure, configuration, platform, or other groups. It also allows fine-grained control over dependencies and content flow. In terms of behavior and dependency resolution, this is the same as using project.json

Additional information regarding VS2017 updates.

-one
source share

All Articles