【问题标题】:Package Manager Console hangs on npm init包管理器控制台在 npm init 上挂起
【发布时间】:2020-01-23 14:54:33
【问题描述】:

所以我正在尝试在 NuGet 中运行基本的 npm 安装,当我运行“npm init”时,它在到达这里之后立即挂起:

This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.

此时它不会响应任何命令,^C 也不做任何事情。

我尝试过重新安装 npm,更新 npm,关闭并重新打开 Visual Studio 2019,没有任何问题。 我能找到的所有帮助都表明这是几年前的一个问题,但修复是要么恢复最近的 npm 更新,要么只是等待新版本发布,所以我不确定为什么我会看到2020 年。

我能够使用“npm init -y”安装我的 package.json,所以我认为这不会损害我的项目,但我仍然想确保我的设置没有任何完全错误

【问题讨论】:

    标签: npm nuget nuget-package visual-studio-2019 npm-init


    【解决方案1】:

    包管理器控制台在 npm init 上挂起

    问题还没解决

    事实上,这是 NuGet 包管理器控制台本身的一个已知问题。

    它的主要功能是为您的项目管理 (install/change/uninstall/etc.) NuGet 包,它旨在运行 PowerShell 命令。而且它只是部分集成,因此它对于外部 npm 工具 的工作不如完整的 Powershell 完美。

    我已将此主题报告给 DC 论坛,以便向相关工作人员反映此问题。 here 是链接。任何遇到相同问题的人都会在这里投票,您也可以在链接中添加任何详细的评论,这将引起微软的极大关注。

    由于该过程可能需要很长时间并且作为一种解决方法,您可以试试我的建议:

    1)通过菜单Tools-->Command Line-->Developer PowerShell使用外部Powershell而不是Nuget Package Console

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-23
      • 1970-01-01
      • 1970-01-01
      • 2011-07-10
      • 2015-08-24
      • 2013-01-03
      • 1970-01-01
      相关资源
      最近更新 更多