简体   繁体   English

正在运行Grunt,无法连接到本地主机

[英]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.

相关问题 Docker 无法连接到本地主机 - Docker Unable to connect to localhost 运行Django时无法连接到localhost - Cannot connect to localhost when running Django El Capitan无法通过LAN中的外部设备连接到Localhost服务器 - El Capitan Unable to Connect to Localhost Server Via External Device in LAN 尝试将 php 文件连接到 localhost:localhost 当前无法处理此请求。 HTTP 错误 500 - Trying to connect php file to localhost: localhost is currently unable to handle this request. HTTP ERROR 500 无法连接到本地 redis docker 尽管启动并运行 - Unable to connect to local redis docker although up and running psql:无法连接到服务器:连接被拒绝服务器是否在主机“ localhost”(:: 1)上运行并在端口5432上接受TCP / IP连接? - psql: could not connect to server: Connection refused Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432? os x 上的 rabbitmqctl start_app 错误:无法连接到节点 rabbit@localhost: nodedown - rabbitmqctl start_app error on os x: unable to connect to node rabbit@localhost: nodedown 无法连接到在 localhost Mac OS v10.15.5 上运行的 java SFTP 服务器 - Can not connect to java SFTP server running on localhost Mac OS v10.15.5 macOS Sierra:Localhost无法连接 - macOS Sierra: Localhost will not connect Jetty Docker 容器运行 spring 应用程序无法连接到 mysql 容器外运行 - Jetty Docker container running spring application unable to connect to mysql running outside docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM