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

Bra*_*ler 6 npm nuget nuget-package npm-init visual-studio-2019

所以我试图在 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.
Run Code Online (Sandbox Code Playgroud)

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

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

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

Mr *_*ian 5

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

问题到现在都没有解决

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

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

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

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

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

希望能帮到你。