VSCodeで can't find node.js binary "deno": path does not exist.
エラー対処
can't find node.js binary "deno": path does not exist. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json
発生した問題
deno
をインストールしてdeno -V
でバージョンが返ってくるのに"runtimeExecutable": "deno"
でPATHがないと怒られる。
環境
os: windows 11
version: 21H2
手続き
一応インストール済みか確認する
deno -V
> deno 1.18.2
deno
がどこにインストールされているのかを確認する
where.exe deno
> C:\Users\<ユーザー名>\.deno\bin\deno.exe
vscodeに戻ってlaunch.json
を開く
launch.json
{
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "main.ts",
"type": "pwa-node",
"program": "${workspaceFolder}/main.ts",
"cwd": "${workspaceFolder}",
//先ほど確認したパスに'\'を増やして記述
"runtimeExecutable": "C:\\Users\\<ユーザ名>\\.deno\\bin\\deno.exe",
"runtimeArgs": [
"run",
"--inspect",
"--allow-read",
"--allow-net"
],
"attachSimplePort": 9229
}
]
}
これで治りました。