技術共有

vscode での Eslint エラー ENOENT

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

[Info  - 5:36:19 PM] ESLint server is starting.
[Info  - 5:36:20 PM] ESLint server running in node v20.9.0
[Info  - 5:36:20 PM] ESLint server is running.
Uncaught exception received.
Error: spawn D:UsersglscAppDataLocalProgramsMicrosoft VS CodeCode.exe ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

解決:

1. eslint のグローバル構成を見つける vscode の設定で eslint を検索できます。

2. ファイルを変更する

    // "eslint.nodePath": "C:\Users\glsc\AppData\Roaming\npm", 
    // 删除上面一行,增加下面一行
    "eslint.runtime": "node",