After updating the gatsby package from 2.0.91 to 2.0.119 i got
```
Error: Cannot find module 'graphql'
v8-compile-cache.js:159 require
[source]/[v8-compile-cache]/v8-compile-cache.js:159:20
index.js:5 Object.
[source]/[graphql-type-json]/lib/index.js:5:16
v8-compile-cache.js:178 Module._compile
[source]/[v8-compile-cache]/v8-compile-cache.js:178:30
v8-compile-cache.js:159 require
[source]/[v8-compile-cache]/v8-compile-cache.js:159:20
graphql.js:4 Object.
[source]/[gatsby]/graphql.js:4:21
v8-compile-cache.js:178 Module._compile
[source]/[v8-compile-cache]/v8-compile-cache.js:178:30
So i did install the `graphql` package.
After that i got
success open and validate gatsby-configs — 0.235 s
success load plugins — 0.131 s
success onPreInit — 0.075 s
success delete html and css files from previous builds — 0.006 s
success initialize cache — 0.007 s
success copy gatsby files — 0.052 s
success onPreBootstrap — 0.008 s
success source and transform nodes — 0.018 s
error Invalid schema passed
Error: Invalid schema passed
mergeSchemas.js:127
[source]/[graphql-tools]/dist/stitching/mergeSchemas.js:127:19
Array.forEach
mergeSchemas.js:65 mergeSchemasImplementation
[source]/[graphql-tools]/dist/stitching/mergeSchemas.js:65:13
mergeSchemas.js:26 mergeSchemas
[source]/[graphql-tools]/dist/stitching/mergeSchemas.js:26:12
index.js:57 Object.
[source]/[gatsby]/dist/schema/index.js:57:20
Generator.next
util.js:16 tryCatcher
[source]/[bluebird]/js/release/util.js:16:23
promise.js:512 Promise._settlePromiseFromHandler
[source]/[bluebird]/js/release/promise.js:512:31
promise.js:569 Promise._settlePromise
[source]/[bluebird]/js/release/promise.js:569:18
promise.js:614 Promise._settlePromise0
[source]/[bluebird]/js/release/promise.js:614:10
promise.js:694 Promise._settlePromises
[source]/[bluebird]/js/release/promise.js:694:18
async.js:138 _drainQueueStep
[source]/[bluebird]/js/release/async.js:138:12
async.js:131 _drainQueue
[source]/[bluebird]/js/release/async.js:131:9
async.js:147 Async._drainQueues
[source]/[bluebird]/js/release/async.js:147:5
```
I tried, updating all plugins as well as don't use any plugin at all. Nothing helped.
Any ideas?
Can you try deleting node_modules and reinstalling them? You also shouldn't need to install graphql package yourself (please try removing it from package.json before reinstalling dependencies).
Sorry for not mentioned it, but i (off course) tried that.
My site is just a simple personal portfolio site.
I can make the repo public for review if you want @pieh
I can make the repo public for review if you want @pieh
That would be great @Knaackee!
I got the same issue when I install the graphql package. Removing it solved the issue for me, but I get these warnings now:
warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0".
warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".
warning "gatsby > [email protected]" has incorrect peer dependency "graphql@^0.13.0".
I also ran into this issue after upgrading gatsby from 2.0.85 to 2.1.18. In my case, I had "graphql": "0.13.2", in my package.json file. I removed that, blew away .cache and node_modules, reinstalled, and tried to start Gatsby again. Then it worked fine.
I also had trouble with this. I used NVM and was able move up to 10.15.2 and that resolved the issue.
@Knaackee can you link to your repository? We can take a look and help debug that further once that's provided!
Thanks!
Today ive updated the dependencies to the current latest. Now the build works again.
@Knaackee OK! Thanks for letting us know--if this comes up again, please do reply and we can investigate further.
As always, a reproduction is very much appreciated!
Thanks everyone!
Most helpful comment
I got the same issue when I install the
graphqlpackage. Removing it solved the issue for me, but I get these warnings now: