gpt4 book ai didi

gruntjs - 如何在 Cloud9 IDE 中使用 grunt 服务?

转载 作者:行者123 更新时间:2023-12-04 01:51:23 25 4
gpt4 key购买 nike

在我的 Gruntfile.js 中,我尝试这样做:

connect: {
options: {
port: process.env.PORT,
hostname: process.env.IP,
livereload: 35729
}
}

我尝试从 Cloud 9 终端运行,得到以下信息:

Running "serve" task

Running "concurrent:server" (concurrent) task

Running "connect:livereload" (connect) task Fatal error: Port 8080 is already in use by another process.



然后我将 Gruntfile.js 更改为以下内容:
connect: {
options: {
port: 9000,
hostname: process.env.IP,
livereload: 35729
}
}

从终端我得到:

Running "serve" task

Running "concurrent:server" (concurrent) task

Running "connect:livereload" (connect) task Started connect web server on http://0.0.0.0:9000

Running "watch" task Waiting...



但是我如何访问 http://0.0.0.0:9000从云9?
我试过 http://localhost:9000 , http://127.0.0.1:9000 ,我在这里遗漏了什么吗?

最佳答案

更新:在 Cloud9 上,您可以使用端口 8080、8081 和 8082 来完成这项工作。有关详细信息和示例,您可以查看 Multiple Ports .

在 Cloud9 中,8080 端口是唯一对外可访问的端口,因此请将 9000 更改为 8080。
该端口正被另一个进程使用,应先停止该进程。用:

kill -9 $(lsof -i:8080 -t)

并重新启动咕噜声。那可行。

关于gruntjs - 如何在 Cloud9 IDE 中使用 grunt 服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25682120/

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