Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 错误:connect ECONREFUSSED 127.0.0.1:8080_Wordpress_Woocommerce_Gatsby_Woocommerce Rest Api_Gatsby Plugin - Fatal编程技术网

Wordpress 错误:connect ECONREFUSSED 127.0.0.1:8080

Wordpress 错误:connect ECONREFUSSED 127.0.0.1:8080,wordpress,woocommerce,gatsby,woocommerce-rest-api,gatsby-plugin,Wordpress,Woocommerce,Gatsby,Woocommerce Rest Api,Gatsby Plugin,我正在使用飞轮本地的wordpress网站(url:xyz.Local)。我创建了一个新的盖茨比网站使用并添加了盖茨比源代码。我还从woo commerce设置生成了消费者密钥和消费者机密。我将它们添加到配置文件中的api_键中 当我运行gastby develope时,我得到了这个错误 ========== WARNING FOR FIELD products =========== The following error status was produced: Error: connect

我正在使用飞轮本地的wordpress网站(url:xyz.Local)。我创建了一个新的盖茨比网站使用并添加了盖茨比源代码。我还从woo commerce设置生成了消费者密钥和消费者机密。我将它们添加到配置文件中的api_键中

当我运行gastby develope时,我得到了这个错误

========== WARNING FOR FIELD products ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================

08:19:23.204Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products
08:19:23.206Z > gatsby-source-woocommerce: Completed fetching nodes for field: products
warn
========== WARNING FOR FIELD products/categories ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================

08:19:23.213Z > gatsby-source-woocommerce: Fetching 0 nodes for field: products/categories
08:19:23.215Z > gatsby-source-woocommerce: Completed fetching nodes for field: products/categories
warn
========== WARNING FOR FIELD products/attributes ===========
The following error status was produced: Error: connect ECONNREFUSED 127.0.0.1:8080
================== END WARNING ==================


有人能告诉我我错过了什么吗?还是我做错了什么?

我解决了。问题在于插件。 在gatsby source woocommerce的配置选项中, 在字段后面注释所有内容,即在注释之后

{
      resolve: "@pasdo501/gatsby-source-woocommerce",
      options: {

        // Base URL of Wordpress site

        api: "wordpress.domain",

        // set to false to not see verbose output during build
        // default: true
        verbose: true,

        // true if using https. otherwise false.
        https: false,
        api_keys: {
          consumer_key: <key>,
          consumer_secret: <secret>,
        },
        // Array of strings with fields you'd like to create nodes for...
        fields: ["products", "products/categories", "products/attributes"],

       
      },
    },
{
解析:“@pasdo501/gatsby源代码”,
选项:{
//Wordpress站点的基本URL
api:“wordpress.domain”,
//设置为false以在生成过程中看不到详细输出
//默认值:true
没错,
//如果使用https,则为true。否则为false。
https:false,
api_密钥:{
消费者密钥:,
消费者的秘密:,
},
//字符串数组,其中包含要为其创建节点的字段。。。
字段:[“产品”、“产品/类别”、“产品/属性”],
},
},
前往@pasdo501/gatsby source文件夹(节点模块)->gatsby-node.js 将api_version=“wc/v3”更改为“wc/v2”,并 将wpAPIPrefix=null更改为“wp json” 并保存它


瞧,我解决了。问题在于插件。 在gatsby source woocommerce的配置选项中, 在字段后面注释所有内容,即在注释之后

{
      resolve: "@pasdo501/gatsby-source-woocommerce",
      options: {

        // Base URL of Wordpress site

        api: "wordpress.domain",

        // set to false to not see verbose output during build
        // default: true
        verbose: true,

        // true if using https. otherwise false.
        https: false,
        api_keys: {
          consumer_key: <key>,
          consumer_secret: <secret>,
        },
        // Array of strings with fields you'd like to create nodes for...
        fields: ["products", "products/categories", "products/attributes"],

       
      },
    },
{
解析:“@pasdo501/gatsby源代码”,
选项:{
//Wordpress站点的基本URL
api:“wordpress.domain”,
//设置为false以在生成过程中看不到详细输出
//默认值:true
没错,
//如果使用https,则为true。否则为false。
https:false,
api_密钥:{
消费者密钥:,
消费者的秘密:,
},
//字符串数组,其中包含要为其创建节点的字段。。。
字段:[“产品”、“产品/类别”、“产品/属性”],
},
},
前往@pasdo501/gatsby source文件夹(节点模块)->gatsby-node.js 将api_version=“wc/v3”更改为“wc/v2”,并 将wpAPIPrefix=null更改为“wp json” 并保存它