0

我正在尝试安装prettierpnpm install prettier -g当我尝试在终端中运行它时,它给了我以下错误:

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

Error: Cannot find module '/Users/hugosum/pnpm-global/5/node_modules/prettier/bin-prettier.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

当我这样做时which prettier,它给了我/usr/local/bin/prettier。如何进一步调试和解决此问题?

4

1 回答 1

0

通过清理重复的二进制文件解决了这个问题/usr/local/bin

于 2021-06-03T03:10:36.920 回答