【问题标题】:error "gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:错误“gatsby-source-graphql”在运行 sourceNodes 生命周期时抛出错误:
【发布时间】:2020-11-17 04:09:03
【问题描述】:

当我尝试执行 gatsby 时,它会在 .cache 中生成 temp-328932 文件
不应生成 temp-328932 文件,
这是不寻常的行为 我不知道为什么会这样.....

我在尝试执行 gatsby 时遇到了一些问题...
我不确定是什么问题...
但这是我从控制台得到的......

error "gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:

getaddrinfo ENOTFOUND undefined


  Error: getaddrinfo ENOTFOUND undefined

  - From previous event:

  - api-runner-node.js:554 Promise.catch.decorateEvent.pluginName
  /[gatsby]/src/utils/api-runner-node.js:554:9

 warning The gatsby-source-graphql plugin has generated no Gatsby nodes. Do you need it?

 object
 Error: connect ECONNREFUSED
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -4078,

我都尝试过什么...

 gatsby clean
 gatsby develop
 removed node_modules
 removed cache
 removed package-lock.json
 npm uninstall -g gatsby-cli
 npm install -g gatsby-cli
 uninstalled node and re-installed
 uninstalled Visual studio and re-installed

【问题讨论】:

  • 全新安装?如果没有,请提供您的gatsby-node.js,当 Gatsby 尝试生成节点时,那里似乎有些奇怪。
  • 当我尝试执行 gatsby 时,它会在 .cache 中生成 temp-328932 文件,不应生成 temp-328932 文件,这是不寻常的行为,我不确定为什么会发生这种情况。 ....
  • gatsby-node.js 里面有什么东西吗?请提供更多详细信息

标签: javascript node.js node-modules gatsby gatsby-plugin


【解决方案1】:

有时也会因为 Gatsby 版本不同而引发错误。

假设你已经全局安装了 Gatsby,当你克隆其他项目时,可能有两个不同版本的 Gatsby,这可能会引发不必要的错误

  1. 全局卸载 Gatsby

    npm 卸载 -g gatsby-cli

  2. 在你的机器上克隆项目

  3. npm 安装

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-28
    • 2023-01-08
    • 1970-01-01
    • 2019-09-29
    • 2020-07-25
    • 2021-05-08
    • 1970-01-01
    • 2020-04-27
    相关资源
    最近更新 更多