gpt4 book ai didi

node.js - Angular cli 不工作

转载 作者:太空宇宙 更新时间:2023-11-04 02:56:32 24 4
gpt4 key购买 nike

目前我正在学习 angular4 。因此,为此我安装了 Node js ,然后在 Node js 命令提示符中执行以下命令

npm install -g typescript
npm install -g @angular/cli@1.0.0
ng new --ng4 angullar-hello-world

通过这样做,我创建了一个 Angular 项目。然后对于运行项目我输入

ng serve

现在项目运行成功http://localhost:4200

并且在 nod js 命令提示符中,消息为 webpack:compile successfully 。但此后我无法在命令提示符中输入任何内容。命令提示符和项目仍然运行良好,但我无法输入任何单词或命令。我正在使用 Windows 8 和 Node v6.10.2 LTS 。

Please see the image 请任何人帮忙

最佳答案

But after this i cannot type anything in command prompt

等待您输入的程序称为 shell,当您输入 ngserve 时,此 shell 程序会运行 ng 程序并将控制权传递给 ngng 不需要您输入任何内容,因此您无法输入任何内容。为了能够再次输入,您必须:

  1. 退出 ng 并将控制权传回 shell,方法是按Ctrl+C,但这会停止 ng 程序。
  2. 在后台运行 ngserve - START/B ngserve(适用于 Windows)和 long-ngserve&(适用于 Unix 环境)

参见this answer用于在 Windows 后台运行程序。

关于node.js - Angular cli 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43437727/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com