58

VS 2019 throws this info message: "Package restore on project open is disabled. Change the npm package management settings in Project Properties to enable restore on project open."

enter image description here

But I can't find any specific checkbox or "npm properties tab" in project's properties for this. Could you give me some details on it?

Rob
  • 3,556
  • 2
  • 34
  • 53
Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142

2 Answers2

76

In Visual Studio 2019 (and 2022), you can find this global setting in:

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

We have not yet found this setting in Project Properties.

Rob
  • 3,556
  • 2
  • 34
  • 53
Kurtbaby
  • 806
  • 4
  • 4
  • 2
    But I don't want Visual Studio 2019 to "Restore On Project Open". How to avoid this warning? – ChrisTorng Nov 27 '20 at 03:03
  • @ChrisTomg I couldn't find a way. Technically it's a message not a warning, but I get it you probably want a clean Error List window. It won't download modules that exist locally so it usually does nothing. I turned it on to avoid the message. – GoClimbColorado Dec 15 '20 at 05:00
  • 1
    You might want to vote on https://developercommunity.visualstudio.com/content/problem/1243025/cannot-disable-package-restore-on-project-open-is.html – CaringDev Dec 18 '20 at 15:51
  • 1
    or go into options press 'Ctrl+E' and type 'Restore' is the search dialog at the top – Doug Thompson - DouggyFresh Jan 02 '21 at 13:55
  • 2
    I'm getting the reported message, but in the package restore options indicated the "Restore on project open" option is already set to true. "Restore on Save" is false. What gives? – Peter Mar 02 '21 at 16:50
  • @CaringDev, status says it is fixed but it is obviously not. Web Site with VS 16.9.2 shows message. – Maxim Mar 22 '21 at 23:16
  • @ChrisTorng 'Restore' is not 'upgrade' or 'change versions' etc ... there should be no harm in allowing a restore upon projects opening up. I leave it set to True (on Project Open) and have never had an issue. Personally, I think this should be the default. – IdahoB May 11 '21 at 13:15
  • I was getting two of these info messages, then I changed the option mentioned to True, and now I get one. – jessewolfe Jul 23 '21 at 15:21
4

Just found it!!! If it helps anyone in the future

img