gpt4 book ai didi

node.js - 如何使用 asdf 在 Visual Studio Code 中使用 NodeJS 调试? (找不到运行时 'node' )

转载 作者:行者123 更新时间:2023-12-03 12:14:57 30 4
gpt4 key购买 nike

不幸的是,Visual Studio Code 找不到运行时可执行文件 node .

Cannot find node

但是综合终端知道node:

$ which node
/home/user/.asdf/shims/node

怎么介绍 node到 Visual Studio Code 而不将运行时可执行文件添加到 launch.json明确的?
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
[...]
"runtimeExecutable": "~/.asdf/shims/node" // <- want to avoid this
}
]
}

最佳答案

似乎 VSCode 在盲目执行之前首先尝试解析 Node 二进制文件。
就我而言,我没有设置全局 Node 版本,这会导致该检查失败。
我只是简单地设置了一个全局版本,VSCode 的检查通过了,然后它就愉快地运行了本地版本,没有任何特定于 ASDF 的启动配置。

关于node.js - 如何使用 asdf 在 Visual Studio Code 中使用 NodeJS 调试? (找不到运行时 'node' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59564623/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com