当我尝试运行时不断收到此错误
yarn add hasura-cli -D
:
Output:
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'PROJECT_FOLDER\node_modules\hasura-cli\dist\index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.0
当我使用 NVM 管理节点版本时,我尝试了节点 18 和 20。我还尝试全局安装 hasura-cli,但收到了相同的错误。
您是否按照官方文档中提到的方式尝试过? https://hasura.io/docs/latest/hasura-cli/install-hasura-cli/