0

我正在尝试按照中继文档上的分步指南使用 react-relay 制作应用程序。运行yarn install并添加运行的yarn relay脚本后"relay-compiler --src ./src --schema ./schema.graphql --language typescript"。我收到如下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 克隆一些中继示例项目,我收到与所有使用中继的存储库相同的错误消息。

4

1 回答 1

0

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

于 2021-12-19T21:28:36.297 回答