简体   繁体   English

使用纱线运行中继编译器时出现“ENOTDIR”错误

[英]'ENOTDIR' error while running relay-compiler with yarn

I am trying to make an application with react-relay following the step-by-step guide on the relay documentation.我正在尝试按照中继文档的分步指南使用 react-relay 制作应用程序。 After running yarn install and adding the yarn relay script which runs "relay-compiler --src ./src --schema ./schema.graphql --language typescript" .在运行yarn install并添加运行"relay-compiler --src ./src --schema ./schema.graphql --language typescript"yarn relay脚本之后。 And I was getting an ENOTDIR error as below:我收到了一个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.

I have then updated my versions of node, npm, yarn.然后我更新了我的 node、npm、yarn 版本。 And tried cloning some relay example projects from github, and I was getting the same error message with all repos that uses relay.并尝试从 github 克隆一些中继示例项目,我在所有使用中继的存储库中都收到相同的错误消息。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM