'ENOTDIR' 使用 yarn 运行 中继编译器时出错

'ENOTDIR' error while running relay-compiler with yarn

我正在尝试按照中继文档上的分步指南使用 react-relay 创建一个应用程序。在 运行 yarn install 之后添加运行 "relay-compiler --src ./src --schema ./schema.graphql --language typescript"yarn relay 脚本。我收到如下 ENOTDIR 错误:

    $ relay-compiler --src ./src --schema ./schema.graphql --language typescript
    Error: spawn ENOTDIR
        at ChildProcess.spawn (node:internal/child_process:412:11)
        at Object.spawn (node:child_process:698:9)
        at /home/Documents/workspace/react-relay/node_modules/relay-compiler/bin/relay-compiler:1841:31
        at new Promise (<anonymous>)
        at Function.isAvailable (/home/Documents/workspace/react-relay/node_modules/relay-compiler/bin/relay-compiler:1835:12)
        at /home/Documents/workspace/relay-test/node_modules/relay-compiler/bin/relay-compiler:8221:61
        at Generator.next (<anonymous>)
        at asyncGeneratorStep (/home/Documents/workspace/react-relay/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
        at _next (/home/Documents/workspace/react-relay/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
        at /home/Documents/workspace/react-relay/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

然后我更新了我的 node、npm、yarn 版本。并尝试从 github 克隆一些中继示例项目,我在所有使用中继的存储库中收到相同的错误消息。

原来是因为我没有需要的 watchman 包,通过在我的机器上安装 Watchman 解决了这个问题。