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

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

问题描述

当我在 Visual Studio 2015 中打开一个带有 package.json 的项目时,会自动启动 npm install,并且 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 Save 上禁用 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.

另请注意,对于 node.js 项目类型(NTVS)自动包恢复行为目前在 VS2017 中完全禁用.

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天全站免登陆