【发布时间】:2018-11-12 18:19:34
【问题描述】:
我试图设置 VSCode 以便能够调试 Gatsby 代码。 我是 Javascript sourcemaps 的新手,这似乎是问题的原因。
我在启动时看到以下错误:
Cannot launch program "c:\Gatsby\myprogram\node_modules\.bin\gatsby" because corresponding Javascript cannot be found.
我验证了错误中文件 gatsby 的路径存在。
这是我用于 launch.json 的文件:
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceRoot}/node_modules/.bin/gatsby",
"args": ["develop", "-p", "7777"],
"stopOnEntry": false,
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development",
"DEBUG": "gatsby:*"
},
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": []
}
]
}
【问题讨论】:
标签: visual-studio-code xdebug source-maps gatsby