Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 not restoring packages on save

IN VS2017 I have a quick node.js "Hello world" project. The installed template for node.js includes using NPM via an included package.json I am editing the package.json file to include new dependencies. Upon saving package.json VS is supposed to install any new packages that are included.

I started with the project template: Other Languages\TypeScript\Node.js Project Template: Blank Node.js Web Application

I confirmed that the option is enabled for Restoring npm packages on save of package.json

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

But no matter what changes I make to package.json VS won't run npm and install the missing packages. Also if I build or run VS won't automatically install the missing packages. I can right click on npm and select Install Missing Packages which does work.

What am I missing?

enter image description here

like image 257
Bruce C Avatar asked Mar 08 '17 22:03

Bruce C


1 Answers

Restore on Save for NPM packages currently doesn't work in NPM projects. I'm still tracking down the root issue, but I did come across a discussion where they (the NTVS folks) wanted to opt out of some behaviors for Web projects.

There are some context menu options on the npm or individual package nodes to restore/update/etc. You could also create new keyboard shortcuts for these context menu items, but I don't know of a way to make Ctrl+S work.

I'm following up internally to revisit these decisions, but in the meantime, send in feedback so that we have some customer data to point to!

like image 186
Jimmy Avatar answered Nov 05 '22 10:11

Jimmy