1、pnpm i eslint -D,安装eslint时安装成功了
2、当执行 npx eslint --init 进行初始化时报错如下:文章来源:https://uudwc.com/A/V6gGq
node:internal/modules/cjs/loader:942
throw err;
^
Error: Cannot find module 'D:\Program Files\nodejs\node_global\node_modules\npm\bin\npx-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
文章来源地址https://uudwc.com/A/V6gGq