如何在Visual Studio 2015中禁用NPM软件包还原? [英] How can I disable NPM package restore in Visual Studio 2015?

查看:402
本文介绍了如何在Visual Studio 2015中禁用NPM软件包还原?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Visual Studio 2015中打开一个带有package.json的项目时,将自动启动npm安装,并且VS在安装完成之前无响应.

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.

我更喜欢从命令行运行npm install自己;如何停止Visual Studio?

I would much rather prefer running npm install myself from the command line; how can I stop Visual Studio from doing it?

推荐答案

如果您升级到Visual Studio 2017(可以使用免费的社区版",那么VS团队添加了一个选项,可以在项目运行时停止npm运行).开了.它位于工具/选项/项目和解决方案/Web软件包管理/软件包还原下.您可以分别在Project Open和package.json上禁用NPM(和Bower)还原.

If you upgrade to Visual Studio 2017 (the free 'Community Edition' is fine) then the VS team have added an option to stop npm running when a project is opened. It's under Tools/Options/Projects and Solutions/Web Package Management/Package Restore. You can disable NPM (and Bower) restores on Project Open and on package.json Save separately.

还请注意,目前对于VS2017中的node.js项目类型(NTVS)仅 ,自动软件包还原行为已完全禁用.

Note also that for the node.js project types (NTVS) only the automatic package restore behavior is disabled completely in VS2017 at present.

以上答案也适用于Visual Studio 2019.尽管不建议使用Bower支持,但菜单选项位于同一位置.

the above answer also applies to Visual Studio 2019. The menu options are in the same place, although Bower support has been deprecated.

这篇关于如何在Visual Studio 2015中禁用NPM软件包还原?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆