【问题标题】:Trying to run npm in Vs project not working尝试在 Vs 项目中运行 npm 不起作用
【发布时间】:2018-04-18 23:50:37
【问题描述】:

我正在尝试在 Vs 示例项目中运行 npm 命令,但命令是

“不被识别为内部或外部命令”。

我在我的 win 10 笔记本电脑上的“VS 2017 开发人员命令提示符”中完成了此操作。我正在关注How to build Angular App with ASP.net core in Vs 2017 示例,但不经常使用 Vs,因此对于此类项目我不太熟悉它。

最终我想继续 Single Page App 的示例项目,但从上面的示例开始,因为它希望我创建一个 asp.net 核心角度项目。

如何让 npm 命令运行?

Instructions were:
Open a terminal/command prompt and navigate to your project’s directory
cd "D:\src\misc\SuperCoolApp\SuperCoolApp\"
npm install @angular/cli --global

我查看了指向troubleshoot npm 的参考链接,但看起来我的 ProgramFiles 中没有 node.js。如果我尽一切可能安装 Vs,我不应该有 node.js 吗?

【问题讨论】:

    标签: c# asp.net angularjs node.js visual-studio-2017


    【解决方案1】:

    不,nodejs 不附带 Visual Studio。您必须分别install it。安装 nodejs 后,您还将拥有 npm

    如果你想从 Visual Studio 创建 nodejs 项目,并希望在 Visual Studio 中拥有对 nodejs 的智能感知支持,你也必须安装 Node.js Tools for Visual Studio

    Node.js Tools for Visual Studio 自 VS2017 起现已成为 Visual Studio 的一部分。 Read here.

    【讨论】:

    • 我没有看到 Vs 的 Node.js 工具的链接。当我转到上面的链接时,它在 VS 的下载下列出了一堆
    • @Michele 我误会了node tools for vs,他们现在是 VS 的一部分,因为 vs2017。 Read here。所以现在你只需要安装nodejs
    猜你喜欢
    • 2020-02-18
    • 1970-01-01
    • 2022-01-07
    • 1970-01-01
    • 1970-01-01
    • 2015-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多