运行 AngularJS 教程 VSCode

Run AngularJS Tutorial with VSCode

我希望在 AngularJS 教程中尝试 VSCode,比如 step 1,然后进行调试和构建。

我能够得到它 运行,但有点乱,VSCode 不喜欢它。

{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.  
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
    {
        // Name of configuration; appears in the launch configuration drop down menu.
        "name": "Launch app.js",
        // Type of configuration. Possible values: "node", "mono".
        "type": "node",
        // Workspace relative or absolute path to the program.
        "program": "app\js\app.js",
        // Automatically stop program after launch.
        "stopOnEntry": true,
        // Command line arguments passed to the program.
        "args": [],
        // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
        "cwd": ".",
        // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
        "runtimeExecutable": "run.bat",
        // Environment variables passed to the program.
        "env": { }
    }, 
    {
        "name": "Attach",
        "type": "node",
        // TCP/IP address. Default is "localhost".
        "address": "localhost",
        // Port to attach to.
        "port": 5858
    }
]

}

我得到一个 "Error Connection failed",尽管它实际上是 运行 在一个单独的命令提示符 window。

有没有办法让 VSCode 调试像这样只使用 package.json 的简单应用程序,像这样启动:

"start": "http-server -a 0.0.0.0 -p 8000"

谢谢, 德里克

Visual Studio代码只支持Node和Mono调试,不支持在浏览器中调试客户端JavaScript。

如果要在浏览器中调试 Javascript,请使用浏览器工具。如果您想在 VSCode 中试用 node.js 调试支持。从设置调试的示例 node.js 或 express app, then follow the direction in Visual Studio Code website 开始。

如果您想查看 Visual Studio 支持调试的代码,可以在 user voice 中投票。