How can I disable NPM package restore in Visual Studio 2015?

前端 未结 3 766
猫巷女王i
猫巷女王i 2020-12-24 04:17

When I open a project with a package.json in Visual Studio 2015, an npm install is automatically started, and VS is unresponsive until the install is completed.

I wo

3条回答
  •  梦毁少年i
    2020-12-24 04:52

    Visual Studio 2015 Update 2 fixed this issue! Install Update 2 and you should be good to go.

    Direct download: http://go.microsoft.com/fwlink/?LinkId=691129
    Update 2 Release Notes: https://www.visualstudio.com/news/releasenotes/vs2015-update2-vs

    Edit: "fixed" may not be entirely accurate, and it may not be entirely fixed for all users. Maybe we can pin down what everybody's experiencing. To clarify, my experience has been as follows:

    • Prior to Update 2, VS would run 'npm install' every time I opened the .sln, which was very hard to cope with.
    • After Update 2, VS runs 'npm install' in certain scenarios, which is tolerable (in my experience.)

    In my experience, post-patch VS will, upon opening the .sln, run 'npm install' if any of the dependencies in package.json are missing from the node_modules folder (or if the folder itself is missing.)

    You can't disable the 'npm install', so 'fixed' may not quite be correct - however, it doesn't do it on every launch as before, so I consider it a win. Can folks confirm this is the behavior, or are we experiencing different behaviors?

提交回复
热议问题