【发布时间】:2019-05-08 22:55:05
【问题描述】:
我使用create-next-app 安装了一个项目。 我需要使用我的编辑器调试服务器端渲染:vscode。所以我访问了vscode-recipes - how to debug next.js app。
我对配方做了一些小改动,因此我不必在全局范围内安装Next。
这是我的launch.json 配置文件:
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
"runtimeArgs": ["-inspect"],
"port": 9229,
"console": "integratedTerminal"
}
当我运行它时,我收到以下错误:
Error: Use env variable NODE_OPTIONS instead: NODE_OPTIONS="--inspect" next dev
我正在尝试将 runtimeArgs 更改为以下应该可以工作的命令:
"runtimeArgs": ["NODE_OPTIONS=--inspect"] 我收到其他错误:
No such directory exists as the project root: /Users/username/with-redux-thunk-app/NODE_OPTIONS=--inspect
我怎样才能正确表达"NODE_OPTIONS=--inspect" 以便它可以与 vscode 调试器一起使用?
【问题讨论】:
标签: javascript node.js visual-studio-code next.js