Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'gatsby-cli/lib/reporter' #14875

Closed
jaredsilver opened this issue Jun 18, 2019 · 50 comments · Fixed by #14881
Closed

Error: Cannot find module 'gatsby-cli/lib/reporter' #14875

jaredsilver opened this issue Jun 18, 2019 · 50 comments · Fixed by #14881
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: cli Related to the Gatsby CLI

Comments

@jaredsilver
Copy link
Contributor

Description

When trying to do gatsby build, I'm noticing that my custom source plugins as well as Gatsby packages are trying to find gatsby-cli/lib/reporter, so every build fails with something that looks like this:

error Error in "/Users/jaredsilver/projects/marketing-app/node_modules/gatsby-plugin-sharp/gatsby-node.js":

  Error: Cannot find module 'gatsby-cli/lib/reporter'
  Require stack:
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby-plugin-sharp/utils.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby-plugin-sharp/scheduler.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby-plugin-sharp/index.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby-plugin-sharp/gatsby-node.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/bootstrap/index.js
  - /Users/jaredsilver/projects/marketing-app/node_modules/gatsby/dist/commands/build.js
  - /Users/jaredsilver/.nvm/versions/node/v12.2.0/lib/node_modules/gatsby-cli/lib/create-cli.js
  - /Users/jaredsilver/.nvm/versions/node/v12.2.0/lib/node_modules/gatsby-cli/lib/index.js

Environment

I've tried a few different versions of gatsby, gatsby-cli, and where gatsby-cli lives, but this is one example:

  System:
    OS: macOS High Sierra 10.13.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v12.2.0/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 74.0.3729.169
    Firefox: 59.0.2
    Safari: 11.0.3
  npmPackages:
    gatsby: ^2.9.4 => 2.9.6
    gatsby-image: ^2.1.4 => 2.1.4
    gatsby-plugin-emotion: ^4.0.6 => 4.0.7
    gatsby-plugin-portal: ^1.0.7 => 1.0.7
    gatsby-plugin-purgecss: ^4.0.0 => 4.0.0
    gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
    gatsby-plugin-react-svg: ^2.1.1 => 2.1.1
    gatsby-plugin-sass: ^2.0.11 => 2.0.11
    gatsby-plugin-sentry: ^1.0.1 => 1.0.1
    gatsby-plugin-sharp: ^2.1.5 => 2.1.6
    gatsby-source-apiserver: ^2.1.2 => 2.1.2
    gatsby-source-filesystem: ^2.0.39 => 2.0.40
    gatsby-source-graphql: ^2.0.19 => 2.0.19
    gatsby-transformer-sharp: ^2.1.21 => 2.1.21
    gatsby-transformer-yaml: ^2.1.12 => 2.1.12
  npmGlobalPackages:
    gatsby-cli: 2.6.9
@DSchau
Copy link
Contributor

DSchau commented Jun 18, 2019

This is very weird. If we look at gatsby-cli@2.6.9, we can see that that file exists like we'd expect: https://unpkg.com/gatsby-cli@2.6.9/lib/reporter/index.js

Not an ideal solution, but I'd guess that using the local version of the Gatsby CLI, e.g. something like (in package.json):

{
  "scripts": {
    "build": "gatsby build"
  }
}

and then npm run build would iron out the issue--but we'll still want to get this fixed.

My initial thinking is that #14220 may contain a breaking change we'll need to iron out.

@jabranr
Copy link
Contributor

jabranr commented Jun 18, 2019

Having exactly the same issue! Rolling back to previous version fixes it.

Can confirm that it can be reproduced with node 8.10.0. Works fine with >8.11.0

@jaredsilver
Copy link
Contributor Author

Indeed, pinning at 2.6.8 locally seems to sort of work for now if I use npm run build. Interestingly I get some new errors I've never seen before -- perhaps unrelated though:

success open and validate gatsby-configs - 0.011 s
success load plugins - 2.161 s
success onPreInit - 0.008 s
success delete html and css files from previous builds - 0.076 s
success initialize cache - 0.020 s
success copy gatsby files - 0.054 s
success onPreBootstrap - 0.008 s
⠹ source and transform nodes
error (node:35205) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
success source and transform nodes - 5.634 s
success building schema - 0.649 s
success Downloading remote files — 330/330 - 6.284 s
success createPages - 0.422 s
success createPagesStatefully - 0.112 s
success onPreExtractQueries - 0.006 s
success update schema - 0.041 s
success extract queries from components - 0.247 s
success write out requires - 0.007 s
success write out redirect data - 0.002 s
success onPostBootstrap - 0.002 s
⠀
info bootstrap finished - 11.305 s
⠀
success run static queries - 0.050 s — 10/10 219.06 queries/second
success Building production JavaScript and CSS bundles - 60.368 s
success Rewriting compilation hashes - 0.003 s
error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in
 the componentWillUnmount method.
success run page queries - 19.443 s — 411/411 21.15 queries/second

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! datacamp-marketing-app@0.1.0 build: `gatsby build`
npm ERR! Exit status 1

@jaredsilver
Copy link
Contributor Author

(I can't tell if these are related to my app or related to something within Gatsby. I'm inclined to believe it's related to Gatsby given that these were not issues in previous versions.)

@vernonmu
Copy link

Encountered this issue, too. Using Node 10.15.0

@vernonmu
Copy link

vernonmu commented Jun 18, 2019

When I install gatsby-cli locally (npm install --save gatsby-cli), and run gatsby develop, I encounter this error:

`Error Warning: Can't perform a React state update on an unmounted
component. This is a no-op, but it indicates a memory leak in your

error UNHANDLED REJECTION

TypeError: Cannot read property 'type' of undefined

  • reporter.js:78 Object.done
    [mcmc2]/[gatsby]/[gatsby-cli]/lib/reporter/reporters/ink/reporter.js
    :78:54

  • index.js:132 Object.end
    [mcmc2]/[gatsby]/[gatsby-cli]/lib/reporter/index.js:132:18

  • index.js:134
    [mcmc2]/[gatsby]/dist/bootstrap/index.js:134:14

  • Generator.next`

@wardpeet
Copy link
Contributor

Oh my, I'll have a look.

@isaacrodriguezcubells
Copy link

Same error here with node v9.11.2
If I use gastby cli 2.6.9 I have:
Error: Cannot find module 'gatsby-cli/lib/reporter'
If I downgrade to gastby cli 2.6.7 I have:
Error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method in GatsbyReporter

@MitchellCash
Copy link

I'm seeing the same issue.

Attempting to bump the following dependencies in my project:

  • Bump gatsby-source-filesystem from 2.0.39 to 2.0.40
  • Bump gatsby-plugin-sharp from 2.0.35 to 2.1.6

Both are failing my CI tests with:

Error: Cannot find module 'gatsby-cli/lib/reporter'

Build logs here:

The change log for gatsby-source-filesystem only includes changes from PR #14220 so would agree with @DSchau on potentially blaming that.

@jabranr
Copy link
Contributor

jabranr commented Jun 18, 2019

I tried different versions of node by setting "engines": { "node": "8.10.0" } and dependencies: { "node": "8.10.0" } and it just produces the same errors. I have tried with 8.10.0, 8.11.0 and 8.11.2.

@ocsross96
Copy link

Seeing this issue too. As others have mentioned I'm able to get round this for the moment by installing the latest gatsby-cli package locally (2.6.9)

npm install --save-dev gatsby-cli

@ArthurHwang
Copy link

Been pulling my hair out suddenly cant develop on my gatsby project. I've tried installing many different versions of node / npm all with the same error

@gallivanmedia
Copy link

Strange. The main project I'm working on is unaffected... but, if I try a fresh default project or "wordpress-tutorial-site", I can't even "gatsby develop" those. I had just ran "npm i gatsby-cli" not too long ago.

@DanielRuf
Copy link
Contributor

DanielRuf commented Jun 18, 2019

Strange. The main project I'm working on is unaffected... but, if I try a fresh default project or "wordpress-tutorial-site",

Because it probably uses the lockfile which uses an older release.

@KyleAMathews
Copy link
Contributor

If y'all delete your lock files and reinstall, does that help?

@ylor
Copy link

ylor commented Jun 18, 2019

If y'all delete your lock files and reinstall, does that help?

Negative

@MitchellCash
Copy link

@KyleAMathews same issue still.

Ran:

  1. rm -fr package-lock.json node_modules/
  2. npm install
  3. npm run develop
  4. Error: Cannot find module 'gatsby-cli/lib/reporter'

@lparvinsmith
Copy link

Hi, I'm using Gatsby for the first time today. I followed the Quick Start docs and got up to the point where I run gatsby develop... and get the same error above: Error: Cannot find module 'gatsby-cli/lib/reporter'

Using Gatsby v2.6.9 and tried with both Node v10.15.3 and v8.5.0.

@DanielRuf
Copy link
Contributor

#14875 (comment)

Oh my, I'll have a look.

@DSchau
Copy link
Contributor

DSchau commented Jun 18, 2019

@MitchellCash I've been using your reproduction to test this.

To Reproduce

(I'm using Node 11 and NPM 6.7.0; may matter)

  1. git clone git@github.com:MitchellCash/MitchellCash.com.git
  2. cd MitchellCash.com
  3. git fetch origin dependabot/npm_and_yarn/gatsby-source-filesystem-2.0.40 && git checkout dependabot/npm_and_yarn/gatsby-source-filesystem-2.0.40
  4. npm install
  5. npm run build

Info

What I'm seeing currently:

  1. gatsby@2.8.8 (what you depend upon, version may not matter here) has a dependency on gatsby-cli
  2. For whatever reason, with npm, this dependency is not installed (ls node_modules | grep gatsby-cli returns nothing)
  3. This issue does not manifest itself with yarn

I'd imagine other people can confirm this as well. While I investigate further, this should be able to be fixed now with a temporary band-aid:

npm install gatsby-cli --save-dev

This will ensure the dependency makes its way into your node_modules tree. This shouldn't be necessary, so please treat this as temporary.

@ronva ronva added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: cli Related to the Gatsby CLI labels Jun 18, 2019
@MitchellCash
Copy link

MitchellCash commented Jun 18, 2019

@DanielRuf reproduced locally with node v10.15.3 / npm v6.9.0 and also on my continuous deployment pipeline which uses node v8.16.0 / npm v6.4.1. @DSchau also reproduced with node v11 / npm v6.7.0.

@DSchau thanks for reproducing and providing a temporary fix!

@zappys
Copy link

zappys commented Jun 18, 2019

If i npm install gatsby-cli locally i get into another issue :

error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in
your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

@doodybrains
Copy link

Seems like a similar issue - I recently updated Gatsby to latest version and my Netlify deploy is hanging at success Rewriting compilation hashes - 0.003 s

@MunifTanjim
Copy link
Contributor

MunifTanjim commented Jun 18, 2019

This is caused by 967597c

  • gatsby-plugin-sharp: src/utils.js
  • gatsby-source-filesystem: src/utils.js

Because of require(`gatsby-cli/lib/reporter`)

This error doesn't occur for yarn because yarn flattens the node_modules tree. So, gatsby-cli is available at ./node_modules/gatsby-cli. With npm it's ./node_modules/gatsby/node_modules/gatsby-cli.

It works after npm install gatsby-cli --save-dev because, it adds gatsby-cli at top level: ./node_modules/gatsby-cli

@wardpeet @DanielRuf

@jkaracozoff
Copy link

jkaracozoff commented Jun 18, 2019

@zappys - I'm getting same error after running npm install gatsby-cli --save-dev

The output is:
error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous
error UNHANDLED REJECTION
TypeError: Cannot read property 'startTime' of undefined

@DanielRuf
Copy link
Contributor

@MunifTanjim he is aware of it, see #14875 (comment)

@w0404884
Copy link

@zappys - I'm getting same error after running npm install gatsby-cli --save-dev

The output is:
error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous
error UNHANDLED REJECTION
TypeError: Cannot read property 'startTime' of undefined

I am also getting this after adding gatsby-cli

@604karev
Copy link

604karev commented Jun 18, 2019

Hi, I try gatsby today firs time, and has the same issuse, I am created gatsby-site run npm start and fet error:

 Error: Cannot find module 'gatsby-cli/lib/reporter'

  - loader.js:636 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:636:15

  - loader.js:562 Function.Module._load
    internal/modules/cjs/loader.js:562:25

  - loader.js:690 Module.require
    internal/modules/cjs/loader.js:690:17

  - v8-compile-cache.js:159 require
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - utils.js:15 Object.<anonymous>
    [gatsby-garb]/[gatsby-source-filesystem]/utils.js:15:18

  - v8-compile-cache.js:178 Module._compile
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:787 Object.Module._extensions..js
    internal/modules/cjs/loader.js:787:10

  - loader.js:653 Module.load
    internal/modules/cjs/loader.js:653:32

  - loader.js:593 tryModuleLoad
    internal/modules/cjs/loader.js:593:12

  - loader.js:585 Function.Module._load
    internal/modules/cjs/loader.js:585:3

  - loader.js:690 Module.require
    internal/modules/cjs/loader.js:690:17

  - v8-compile-cache.js:159 require
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - create-file-node.js:7 Object.<anonymous>
    [gatsby-garb]/[gatsby-source-filesystem]/create-file-node.js:7:18

  - v8-compile-cache.js:178 Module._compile
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:787 Object.Module._extensions..js
    internal/modules/cjs/loader.js:787:10

  - loader.js:653 Module.load
    internal/modules/cjs/loader.js:653:32

  - loader.js:593 tryModuleLoad
    internal/modules/cjs/loader.js:593:12

  - loader.js:585 Function.Module._load
    internal/modules/cjs/loader.js:585:3

  - loader.js:690 Module.require
    internal/modules/cjs/loader.js:690:17

  - v8-compile-cache.js:159 require
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - gatsby-node.js:12 Object.<anonymous>
    [gatsby-garb]/[gatsby-source-filesystem]/gatsby-node.js:12:19

  - v8-compile-cache.js:178 Module._compile
    [gatsby-garb]/[v8-compile-cache]/v8-compile-cache.js:178:30


⠋ load plugins
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default@0.1.0 develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-default@0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Home\AppData\Roaming\npm-cache\_logs\2019-06-18T19_15_54_990Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default@0.1.0 start: `npm run develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-default@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

When I asked google about my problem and he give me an solution [#4122](https://github.com/gatsbyjs/gatsby/pull/4122), I tryed this, but get another error, I forgot but something with sdk 8.1, I'm installed sdk, install gatsby-plugin-sharp 1.6.31 the problem is not gone

@polkhovsky
Copy link

As an immediate workaround you can use yarn instead of npm
rm -rf node_modules
yarn
gatsby develop

@DanielRuf
Copy link
Contributor

@604karev see #14881

@604karev
Copy link

@polkhovsky , thanks, this works for me

@doodybrains
Copy link

doodybrains commented Jun 18, 2019

I get a different error when running yarn after removing node_modules

Fetch Contentful data: 4556.579ms
success source and transform nodes - 6.949 s
⠹ building schema


  Error: Schema must contain uniquely named types but contains multiple types named "JSON".

  - Array.reduce

  - Array.reduce

@wardpeet
Copy link
Contributor

@doodybrains that seems something else, could you create another issue for this.

I think I fixed the issue with NPM. I would love if people can test it out for me. I've updated a lot of packages so please install the correct packages. For example if you have gatsby-source-wordpress installed, please install gatsby-source-wordpress@reporter-npm

I published some versions to test, please install the ones that are in your package.json
npm install gatsby-plugin-sharp@reporter-npm
npm install gatsby-source-contentful@@reporter-npm
npm install gatsby-source-drupal@reporter-npm
npm install gatsby-source-filesystem@reporter-npm
npm install gatsby-source-shopify@reporter-npm
npm install gatsby-source-wordpress@reporter-npm
npm install gatsby-transformer-screenshot@reporter-npm
npm install gatsby-transformer-sqip@reporter-npm

@gcjbr
Copy link

gcjbr commented Jun 18, 2019

+1 for @polkhovsky 's workaround

@jkaracozoff
Copy link

jkaracozoff commented Jun 18, 2019

@wardpeet I tried with NPM, I ran these commands:
rm -fr package-lock.json node_modules/
npm install
gatsby develop

And I got this error:
error Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous

error UNHANDLED REJECTION

TypeError: Cannot read property 'type' of undefined

- reporter.js:78 Object.done [myblog]/[gatsby]/[gatsby-cli]/lib/reporter/reporters/ink/reporter.js:78:54

- index.js:132 Object.end [myblog]/[gatsby]/[gatsby-cli]/lib/reporter/index.js:132:18

- index.js:134 [myblog]/[gatsby]/dist/bootstrap/index.js:134:14

- Generator.next

@narration-sd
Copy link

And anyway, requiring to use yarn not a valid option.

I'm having all this on node 12.4.0 / npm 6.9.0, just trying to set up a demo for a doc purpose.

Thanks to @MunifTanjim above for tieing this down for causes!

Maybe we could get #14800 repaired also, to stop similar new trying user befuddlement??

Thanks

@doodybrains
Copy link

doodybrains commented Jun 18, 2019

@wardpeet thank you. i npm installed for plugin-sharp and source-contentful but got

after running yarn develop

error Plugin gatsby-transformer-sharp returned an error


  Error: Cannot find module 'sharp'

tried running

npm install gatsby-transformer-sharp@reporter-npm

but that returned an error.

@doodybrains
Copy link

@wardpeet sorry. i removed gatsby-transformer-sharp and now everything works...

@wardpeet
Copy link
Contributor

@jkaracozoff that seems a different bug, any reproduction you can create for me? Feel free to send me a private email ward@gatsbyjs.com

@wardpeet
Copy link
Contributor

@narration-sd it's getting a bit late for me, I'll try to get to it this week.

@narration-sd
Copy link

@wardpeet Thanks, friend -- fully understand about the 'getting late' part, just did that in the other timezone direction as often, last night...

@jkaracozoff
Copy link

jkaracozoff commented Jun 18, 2019

UPDATE: NPM appears to be working now, don't forget to install ALL the packages you need (he said to himself...), thanks @wardpeet !

npm install gatsby-plugin-sharp@reporter-npm
npm install gatsby-source-contentful@@reporter-npm
npm install gatsby-source-drupal@reporter-npm
npm install gatsby-source-filesystem@reporter-npm
npm install gatsby-source-shopify@reporter-npm
npm install gatsby-source-wordpress@reporter-npm
npm install gatsby-transformer-screenshot@reporter-npm
npm install gatsby-transformer-sqip@reporter-npm

@benryerson
Copy link

Following @wardpeet 's instructions and installing the necessary @reporter-npm packages works.

For me, it was the following:
npm install gatsby-plugin-sharp@reporter-npm
npm install gatsby-source-filesystem@reporter-npm

Thank you!

@wardpeet
Copy link
Contributor

wardpeet commented Jun 18, 2019

we rolled back the change for now so the latest npm packages shouldn't have this issue. We'll reiterate on the reporter-npm fix and ship it somewhere this week.

Thanks for sticking with us and helping us debug this issue! ❤️ Sorry for the inconveniences it may have caused.

Successfully published:
 - gatsby-cli@2.6.10
 - gatsby-plugin-sharp@2.1.7
 - gatsby-source-contentful@2.0.73
 - gatsby-source-drupal@3.1.14
 - gatsby-source-filesystem@2.0.41
 - gatsby-source-shopify@2.0.39
 - gatsby-source-wordpress@3.0.67
 - gatsby-transformer-sqip@2.0.44
 - gatsby@2.9.7

@MitchellCash
Copy link

@wardpeet thanks for the quick responses!

I bumped my dependencies to the latest and we are all good again!

I also tested the two in development dependencies and they also solved this problem for me:

  • gatsby-plugin-sharp@reporter-npm
  • gatsby-source-filesystem@reporter-npm

@narration-sd
Copy link

narration-sd commented Jun 18, 2019

Just to add for others: you do apparently need to add the two @reporter-related libraries, after getting npm to actually install and use the back-versioned gatsby-cli (by npm -g remove gatsby-cli, locally also if you have one there).

The library adds, as close above from @benryerson, done in the created new site:

  • npm install gatsby-plugin-sharp@reporter-npm
  • npm install gatsby-source-filesystem@reporter-npm

With these, it works, and thanks again @wardpeet @MunifTanjim

@narration-sd
Copy link

narration-sd commented Jun 19, 2019

@MitchellCash Mitchell, I'm trying to understand what exactly you meant about having success by 'bump[ing] dependencies'

I've got the fixed gatsby-cli of today to work in creating a buildable site, but only by fresh gatsby new sitename followed by manual npm install of both @reporter-npm tagged plugins.

To discover your meaning, I tried several variations on removing node_modules and package-lock.json, then npm install. As far as I know, this kind of trash-restore is the only way to get npm to prefer currently 'updated' dependencies, other than some obscure scripting plugins. My unsuccessful variations meant doing npm cache clear --force and -g version before the clean npm install.

Or did you mean manually changing all the versions in the list above from @wardpeet in the package.json, then npm update to call them into node_modules? Just thought of that, will have to try it.

[added] And no, that didn't work either. I continue to get the error WebpackError: ./.cache/develop-static-entry.js, until I install the two @reporter-npm additions.

You guys will have to forgive a little. I've just come off a tug of war with npm over updates to .beta-n plugins, which in fact it won't do. You have to go manual or remove-add there. That's the kind of iron rule I'm looking to understand here.

@MitchellCash
Copy link

@narration-sd what I meant was the following versions worked for me:

  • gatsby-plugin-sharp@2.1.7
  • gatsby-plugin-sharp@reporter-npm
  • gatsby-source-filesystem@2.0.41
  • gatsby-source-filesystem@reporter-npm

The following (the cause of this whole issue thread) did not work for me:

  • gatsby-plugin-sharp@2.1.7
  • gatsby-source-filesystem@2.0.40

If you are still having issues you might want to wait for the Gatsby dependencies in https://github.com/gatsbyjs/gatsby-starter-default/blob/master/package.json to be bumped to the latest versions as they are still pointing to the broken versions (as of the time I write this).

Once that is done you will be able to run gatsby new sitename again without having to manually install different versions from the starter.

@wardpeet
Copy link
Contributor

we just published a new version, i'll be bumping our starters in a few minutes.

@narration-sd
Copy link

@MitchellCash Thanks for the clarification, Mitchell. What you say is exactly what I arrived at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: cli Related to the Gatsby CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.