vue3 vite4 安装eslint进行初始化时报错

1、pnpm i eslint -D,安装eslint时安装成功了

2、当执行 npx eslint --init 进行初始化时报错如下:

node:internal/modules/cjs/loader:942
  throw err;
  ^

Error: Cannot find module 'D:Program Filesnodejsnode_globalnode_modulesnpmbinnpx-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at Module._load (node:internal/modules/cjs/loader:780:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.0.0