[英]Running Grunt, Unable to connect to localhost
I am running a yeoman app when I run the server everything passes, but I get this odd port for the server, 当我运行服务器时,我正在运行yeoman应用程序,但是一切正常,但是我得到了服务器的这个奇怪端口,
Matt-MacbookPro:places mattbtay$ grunt serve
Running "serve" task
Running "clean:server" (clean) task
Cleaning .tmp...OK
Running "concurrent:server" (concurrent) task
Running "copy:styles" (copy) task
Done, without errors.
Running "compass:server" (compass) task
directory .tmp/styles/
create .tmp/styles/main.css (7.533s)
Compilation took 7.536s
Done, without errors.
Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/styles/main.css" created.
Running "connect:livereload" (connect) task
Started connect web server on ::1:9000.
Running "watch" task
Waiting...
I would normally just want to load "localhost:9000" and the server would run find. 我通常只想加载“ localhost:9000”,服务器将运行find。 But as it currently is, I have to enter that manually, is there something I have changed on my system that would be connecting to ::1:9000?
但就目前而言,我必须手动输入该密码,我的系统上是否有更改将要连接到:: 1:9000的内容?
Actually ::1
is not a port, it's an IPv6 localhost address . 实际上
::1
不是端口,它是IPv6本地主机地址 。
Looks like your Grunt tries to use IPv6, perhabs your system is confgiured to prefer IPv6. 看起来您的Grunt尝试使用IPv6,使您的系统配置为偏爱IPv6。
Run $ ifconfig
and make sure that IPv4 line is present on lo
interface: inet addr:127.0.0.1 Mask:255.0.0.0
. 运行
$ ifconfig
并确保lo
接口上存在IPv4行: inet addr:127.0.0.1 Mask:255.0.0.0
。
If you can see only inet6 addr: ::1/128
, when you simply don't have IPv4 enabled/configured. 如果仅没有启用/配置IPv4时,仅能看到
inet6 addr: ::1/128
。
No IPs should be hard-coded into Grunt configuration generated by Yeoman - it looks up the IP bound to localhost
. 不应将任何IP硬编码到Yeoman生成的Grunt配置中-它查找绑定到
localhost
的IP。 Check out connect
task configuration in https://github.com/yeoman/generator-angular/blob/master/templates/common/Gruntfile.js . 在https://github.com/yeoman/generator-angular/blob/master/templates/common/Gruntfile.js中检查
connect
任务配置。 You should have sth similar in your local Gruntfile. 您在本地Gruntfile中应该有类似的东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.