簡體   English   中英

Visual Studio代碼node.js調試器無法在標准啟動時附加

[英]visual studio code node.js debugger fails to attach on standard launch

我嘗試使用visualstudio代碼提供的簡單node.js示例,但是不幸的是,當從Visual Studio代碼(在OS X上)啟動節點時,該節點開始使用任意的debug-brk啟動,但是調試器附件失敗。

當我使用--debug-brk = 5858手動運行節點應用程序,然后使用附加程序時,我可以調試我的應用程序。 有人遇到同樣的問題嗎?

PS我從mono項目頁面.pkg安裝了mono。

這是我的launch.js:

{
"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",
        // Type of configuration. Possible values: "node", "mono".
        "type": "node",
        // Workspace relative or absolute path to the program.
        "program": "./bin/www",
        // 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": null,
        // 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
    }
]

}

只是遇到了同樣的問題...代碼找不到Node。

更改此行以指向您的可執行文件,例如:

“ runtimeExecutable”:“ C:/程序文件/nodejs/node.exe”,

請享用!

可能是集群的東西。 嘗試關閉./bin/www中的群集,您將能夠對其進行調試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM