【发布时间】:2016-11-28 09:25:41
【问题描述】:
在 vs 代码中,我在一个 HTML angularjs 项目中创建了一个launch.json 文件。我无法在我的本地主机中启动该项目。它一直说Failed to load resource: net::ERR_CONNECTION_REFUSED (http://localhost:8080/)。
项目结构:-
Project => .vscode => launch.json
=> app
=> scripts
=> styles
=> index.html
launch.json:-
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
},
{
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
}
]
}
有人可以帮我解决这个问题吗?提前致谢
【问题讨论】:
-
你
/etc/hosts的内容是什么? -
@YanYang 你问的是项目结构吗?我已经更新了帖子。可以查一下吗?
-
@YanYang
/etc/hosts是什么意思? -
在 Linux/macOS 中有一个名为
hosts的文件。cat /etc/hosts可能有助于确定localhost是否是有效的主机名。我遇到过这种问题,但我不确定是不是你的情况。 -
@YanYang 我正在使用 Windows。你能告诉我如何在 Windows 中做到这一点吗?
标签: angularjs typescript google-chrome visual-studio-code