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

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

问题描述

我已经将v6.0.5.0节点和npm v3.10.3的angular-cli安装到我的流浪汉(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.

Thx

推荐答案

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 box中运行angular-cli?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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