gatsby-source-wordpress不起作用

时间:2018-02-10 15:00:15

标签: wordpress gatsby

我是React和Gatsbyjs的新人。我能够使用盖茨比网站的4个教程创建一个网站。当我的页面是js文件或Markdown时,它正在工作。

我尝试安装gatsby-source-wordpress插件,但是当我输入gatsby develop时Gatsby无法导入数据。

我看到这个警告: 警告gatsby-source-wordpress插件没有生成Gatsby节点。你需要吗?

版本:

Gatsby => 39年1月1日

Node => v8.9.4

Mac High Sierra 10.13.3

我在dreamhost vps主机上使用全新安装的WordPress 4.9.4。 该网站正在使用来自Let's encript的https!

这是我在终端中看到的消息。

success delete html files from previous builds — 0.010 s
success open and validate gatsby-config.js — 0.003 s
info One or more of your plugins have changed since the last time you ran 
Gatsby. As
a precaution, we're deleting your site's cache to ensure there's not any stale
data
success copy gatsby files — 0.041 s
success onPreBootstrap — 0.007 s
⡀ source and transform nodes -> wordpress__POST fetched : 1
 source and transform nodes -> wordpress__PAGE fetched : 3
⠈ source and transform nodes -> wordpress__wp_media fetched : 1
 ⠂ source and transform nodes -> wordpress__wp_types fetched : 1
 ⡀ source and transform nodes -> wordpress__wp_statuses fetched : 1
⠠ source and transform nodes -> wordpress__wp_taxonomies fetched : 1
⠈ source and transform nodes -> wordpress__CATEGORY fetched : 1
⠂ source and transform nodes -> wordpress__TAG fetched : 0
⡀ source and transform nodes -> wordpress__wp_users fetched : 1
 ⠠ source and transform nodesThe server response was "401 Unauthorized"
Inner exception message : "You are not currently logged in."
⠁ source and transform nodes -> wordpress__wp_comments fetched : 1
⠂ source and transform nodesThe server response was "401 Unauthorized"
Inner exception message : "Sorry, you are not allowed to do that."
error Plugin gatsby-source-wordpress returned an error


TypeError: createNodeId is not a function

- normalize.js:170 
  [web]/[gatsby-source-wordpress]/normalize.js:170:12

- Array.map

- normalize.js:169 Object.exports.createGatsbyIds
[web]/[gatsby-source-wordpress]/normalize.js:169:19

- gatsby-node.js:102 _callee$
[web]/[gatsby-source-wordpress]/gatsby-node.js:102:34

 - next_tick.js:131 _combinedTickCallback
internal/process/next_tick.js:131:7

- next_tick.js:180 process._tickCallback
internal/process/next_tick.js:180:9


warning The gatsby-source-wordpress plugin has generated no Gatsby nodes. Do 
you need it?
success source and transform nodes — 2.165 s
success building schema — 0.149 s
success createLayouts — 0.033 s
success createPages — 0.041 s
success createPagesStatefully — 0.011 s
success onPreExtractQueries — 0.001 s
success update schema — 0.078 s
success extract queries from components — 0.073 s
success run graphql queries — 0.049 s
success write out page data — 0.002 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.001 s

info bootstrap finished - 8.626 s

  DONE  Compiled successfully in 1955ms                                  
09:32:09


 You can now view gatsby-starter-hello-world in the browser.

  http://localhost:8000/

  View GraphiQL, an in-browser IDE, to explore your site's data and schema

  http://localhost:8000/___graphql

 Note that the development build is not optimized.
 To create a production build, use gatsby build

  WAIT  Compiling...                                                     
  09:32:10

  DONE  Compiled successfully in 83ms  

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

尝试更新版本的gatsby:

npm install --save gatsby@latest