如何从 Vagrant 框中运行 angular-cli? [英] How to run angular-cli from Vagrant box?

查看:22
本文介绍了如何从 Vagrant 框中运行 angular-cli?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将带有 node v6.5.0 和 npm v3.10.3 的 angular-cli 安装到我的 vagrant (Scotch) 盒子中.运行 'ng serve --port 4201' 后,我可以看到构建成功并且应用程序现在在 http://上提供服务本地主机:4201/

I've installed angular-cli with node v6.5.0 and npm v3.10.3 to my vagrant (Scotch) box. After running 'ng serve --port 4201' I can see that the build was successful and that the app is now serving on http://localhost:4201/

但是我不能只使用上面的地址,因为我在 VM 上运行.我尝试将127.0.0.1:4201"添加到主机上的主机文件中,但无法正常工作.

However I can't just use above address because I'm running on VM. I've tried to add '127.0.0.1:4201' to hosts file on host machine, but can't get anything working.

谢谢

推荐答案

Vagrant (VM) 不会触发文件更改事件.此错误已报告给 VirtualBox 社区,并设置为不会修复.目前无法通过 Vagrant 使用 Angular 2.请参阅 GitHub 上的此问题,了解相关讨论.

Vagrant (VM) doesn't trigger file change events. This bug is reported to VirtualBox community and is set to won't fix. For now it's not possible to work with Angular 2 via Vagrant. See this issue on GitHub for relevant discussion on this.

这篇关于如何从 Vagrant 框中运行 angular-cli?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆