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

Cannot find module 'gatsby-cli/lib/reporter' #26345

Closed
theskillwithin opened this issue Aug 10, 2020 · 23 comments · Fixed by #26357
Closed

Cannot find module 'gatsby-cli/lib/reporter' #26345

theskillwithin opened this issue Aug 10, 2020 · 23 comments · Fixed by #26357
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@theskillwithin
Copy link
Contributor

After updating from gatsby 2.24.36 to version 2.24.40 getting error on npm start:
Error in "/Users/Austin/Projects/schwayweb/node_modules/gatsby-plugin-page-creator/gatsby-node.js": Cannot find module 'gatsby-cli/lib/reporter'

entire output here: https://gist.github.com/theskillwithin/2482854d8aa23e91885799925516c833


  System:
    OS: macOS 10.15.6
    CPU: (12) x64 Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.6 - ~/.nvm/versions/node/v12.14.1/bin/npm
  Languages:
    Python: 2.7.17 - /usr/local/bin/python
  Browsers:
    Chrome: 84.0.4147.105
    Firefox: 79.0
    Safari: 13.1.2
  npmPackages:
    gatsby: ^2.24.40 => 2.24.40 
    gatsby-background-image: ^1.1.1 => 1.1.1 
    gatsby-image: ^2.4.15 => 2.4.15 
    gatsby-plugin-emotion: ^4.3.10 => 4.3.10 
    gatsby-plugin-google-analytics: ^2.3.13 => 2.3.13 
    gatsby-plugin-layout: ^1.3.10 => 1.3.10 
    gatsby-plugin-manifest: ^2.4.22 => 2.4.22 
    gatsby-plugin-offline: ^3.2.23 => 3.2.23 
    gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10 
    gatsby-plugin-root-import: ^2.0.5 => 2.0.5 
    gatsby-plugin-sharp: ^2.6.26 => 2.6.26 
    gatsby-source-contentful: ^2.3.36 => 2.3.36 
    gatsby-source-filesystem: ^2.3.24 => 2.3.24 
    gatsby-source-shopify: ^3.2.26 => 3.2.26 
    gatsby-transformer-remark: ^2.8.28 => 2.8.28 
    gatsby-transformer-sharp: ^2.5.12 => 2.5.12 
@theskillwithin theskillwithin added the type: bug An issue or pull request relating to a bug in Gatsby label Aug 10, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 10, 2020
@sandren
Copy link

sandren commented Aug 11, 2020

Installing gatsby-cli as a project dependency is a temporary workaround.

@KyleAMathews
Copy link
Contributor

I can't duplicate this when I updated a site to 2.24.40 — but I'm also running an up-to-date version of gatsby-cli (2.12.81) — can you try upgrading gatsby-cli to the latest to see if that helps? Perhaps it's older global gatsby-cli versions not working w/ the latest gatsby for some reason.

@MikeCastillo1
Copy link

Hello I have the same issue, when update to "gatsby": "^2.24.40", I also try to move back to "gatsby": "^2.24.37", but error still appears. I got the error on gatsby cloud

@gibsonj
Copy link

gibsonj commented Aug 11, 2020

I can't duplicate this when I updated a site to 2.24.40 — but I'm also running an up-to-date version of gatsby-cli (2.12.81) — can you try upgrading gatsby-cli to the latest to see if that helps? Perhaps it's older global gatsby-cli versions not working w/ the latest gatsby for some reason.

I am also having this issue since updating. I am running gatsby-cli 2.12.82.

As mentioned by @sandren, installing gatsby-cli as a project dependency seems to help as a temporary measure.

In addition, the progress bar showing quantity of images being rendered, or queries being processed is no longer visible.

@theskillwithin
Copy link
Contributor Author

I don't have gatsby cli installed globally

@doubleodenis
Copy link

Just tried porting a create react app to gatsby and I got this issue as well, using gatsby 2.24.40.

@joelvarty
Copy link
Contributor

I'm seeing this on gatsby cloud itself... saw the same error on my local build and it was fixed by updating the CLI, but I can't control that on the cloud service.

@blyatmobilebr-zz
Copy link

blyatmobilebr-zz commented Aug 11, 2020

Unfortunately I'm having the same issue when I try to gatsby develop in my project. I even did:

rm -rf node_modules package-lock.json
npm install
npm run clean
npm run develop

(With gatsby-cli installed globally).

@joelvarty
Copy link
Contributor

OK - weird solution, but it might help others: removed package-lock.json and node_modules, then ran yarn install
Checked that into github and Gatsby Cloud built the site.

@blyatmobilebr-zz
Copy link

blyatmobilebr-zz commented Aug 11, 2020

OK - weird solution, but it might help others: removed package-lock.json and node_modules, then ran yarn install
Checked that into github and Gatsby Cloud built the site.

When I run gatsby develop the following error shows up:

[blyatmobilebr@blyatmobilebr-pc coffee-shop]$ gatsby develop
Debugger listening on ws://127.0.0.1:9229/64580fc3-4d58-4652-9ae6-6648f2debd34
For help, see: https://nodejs.org/en/docs/inspector
success open and validate gatsby-configs - 0.125s

 ERROR 

Error in "/home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/gatsby-node.js": Cannot find module 'gatsby-cli/lib/reporter'
Require stack:
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/is-valid-collection-path-implementation.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/create-pages-from-collection-builder.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/create-page-wrapper.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/gatsby-node.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/services/initialize.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/services/index.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/state-machines/develop/services.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/state-machines/develop/index.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/commands/develop-process.js
- /home/blyatmobilebr/Área de trabalho/coffee-shop/.cache/tmp-12398-m3KLIrnjoKyl



  Error: Cannot find module 'gatsby-cli/lib/reporter'
  Require stack:
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/is-valid-col  lection-path-implementation.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/create-pages  -from-collection-builder.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/create-page-  wrapper.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby-plugin-page-creator/gatsby-node.  js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/resolve-module-ex  ports.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/vali  date.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/load  .js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/bootstrap/load-plugins/inde  x.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/services/initialize.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/services/index.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/state-machines/develop/serv  ices.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/state-machines/develop/inde  x.js
  - /home/blyatmobilebr/Área de trabalho/coffee-shop/node_modules/gatsby/dist/commands/develop-process.js  - /home/blyatmobilebr/Área de trabalho/coffee-shop/.cache/tmp-12398-m3KLIrnjoKyl
  
  - loader.js:1030 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:1030:15
  
  - loader.js:899 Function.Module._load
    internal/modules/cjs/loader.js:899:27
  
  - loader.js:1090 Module.require
    internal/modules/cjs/loader.js:1090:19
  
  - v8-compile-cache.js:159 require
    [coffee-shop]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - is-valid-collection-path-implementation.js:10 Object.<anonymous>
    [coffee-shop]/[gatsby-plugin-page-creator]/is-valid-collection-path-implementation.js:10:40
  
  - v8-compile-cache.js:178 Module._compile
    [coffee-shop]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - loader.js:1221 Object.Module._extensions..js
    internal/modules/cjs/loader.js:1221:10
  
  - loader.js:1050 Module.load
    internal/modules/cjs/loader.js:1050:32
  
  - loader.js:938 Function.Module._load
    internal/modules/cjs/loader.js:938:14
  
  - loader.js:1090 Module.require
    internal/modules/cjs/loader.js:1090:19
  
  - v8-compile-cache.js:159 require
    [coffee-shop]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - create-pages-from-collection-builder.js:28 Object.<anonymous>
    [coffee-shop]/[gatsby-plugin-page-creator]/create-pages-from-collection-builder.js:28:44
  
  - v8-compile-cache.js:178 Module._compile
    [coffee-shop]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - loader.js:1221 Object.Module._extensions..js
    internal/modules/cjs/loader.js:1221:10
  
  - loader.js:1050 Module.load
    internal/modules/cjs/loader.js:1050:32
  
  - loader.js:938 Function.Module._load
    internal/modules/cjs/loader.js:938:14
  

not finished load plugins - 5.449s

@bryndyment
Copy link
Contributor

npm i -D gatsby-cli fixed my Netlify deploy.

I assume I'll be able to remove this dependency once the underlying issue is resolved?

@dan714
Copy link

dan714 commented Aug 11, 2020

I am also experiencing this issue. I am able to work around by fixing the version:

npm install -D gatsby-cli@2.12.21

@dan714
Copy link

dan714 commented Aug 11, 2020

I am also experiencing this issue. I am able to work around by fixing the version:

npm install -D gatsby-cli@2.12.21

Looks like it actually still works without the version.

@dbvisel
Copy link

dbvisel commented Aug 11, 2020

I was having this too. Adding gatsby-cli to my dev dependencies gets rid of the error, but even though develop no longer crashes and it's successfully executing my gatsby-node, it seems like it's hanging after that – I can never get to see anything in the browser.

@elektracodes
Copy link

Me too. Just happened on my Github actions. The previous deploy worked fine and suddenly, it no longer works.

@pieh pieh added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. topic: page creation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 11, 2020
@pieh
Copy link
Contributor

pieh commented Aug 11, 2020

It looks like

imports gatsby-cli, but the package doesn't declare it in its dependencies
"dependencies": {
"@babel/traverse": "^7.10.2",
"fs-exists-cached": "^1.0.0",
"gatsby-page-utils": "^0.2.20",
"globby": "^11.0.1",
"graphql": "^14.6.0",
"lodash": "^4.17.15",
"slugify": "^1.4.4"
},

@sidharthachatterjee
Copy link
Contributor

sidharthachatterjee commented Aug 11, 2020

Pushing a fix in 5 now

@pvdz pushed a fix, will publish once all is green

@sidharthachatterjee
Copy link
Contributor

Fixed and published in gatsby@2.24.42 courtesy of @pvdz

@malisbad
Copy link

For anyone who is still having problems getting this to work, especially on a new install, I had to delete the package-lock.json and then manually change the package.json entry for gatsby to ^2.24.42 from ^2.24.41 in order to get this fix.

@ErickRV19
Copy link

I am trying to start my first project with Gatsby but I continue with the problem, I tried what you mention but I can not correct it.

@malisbad
Copy link

I am trying to start my first project with Gatsby but I continue with the problem, I tried what you mention but I can not correct it.

Try npm i -g gatsby-cli first, then delete package-lock.json, modify package.json, then npm install to update it all. You probably did it correctly, but always good to give it another go. You can also try uninstalling gatsby first.

@pvdz
Copy link
Contributor

pvdz commented Aug 12, 2020

Before reporting to have this problem please make sure the proper gatsby version is installed

npm ls gatsby
└── gatsby@2.24.42

yarn why gatsby
=> Found "gatsby@2.24.42"

If that's not at least .42 then that's probably the reason. Thanks :)

@pvdz
Copy link
Contributor

pvdz commented Aug 12, 2020

Going to lock this because we're confident this particular issue has been fixed.

@gatsbyjs gatsbyjs locked as resolved and limited conversation to collaborators Aug 12, 2020
danithecake added a commit to buninux/buninux.github.io that referenced this issue Aug 25, 2020
578e005 improve(pages): update theming page with Sidebar and initial content
b54393b improve(components): initial ThemeColorPicker implementation
1f883c1 chore(components): wrap ComingSoon content with Main component
fa1d889 improve(components): initial Main implementation
0cd2672 improve(components): intitial Sidebar implementation
bb46f2a improve(component): update Layout structure and styles as page content container
d1d3ef0 improve(styles): appropriate global styles for native HTML elements
2d86938 chore(components): redefine Header border style as JSS array
87779e6 fix(styles): swap theme foreground and background colors
a3d0f4b improve(components): clean up Header styles and add active link state
dad8fb4 chore(package): add classnames dependency
3afd7b4 improve(styles): remove redundant body margin
155bf91 chore(components): clean up Layout component
76f0a14 refactor(pages): initial pages structure config
7ec4820 chore(pages): initial Theming page
f7ad9f7 chore(components): initial Coming Soon page component
cc5cc69 improve(components): initial Header styling
11f6b9a improve(components): initial Layout styling
1c01cea chore(package): capitalize components files names
3580854 chore(styles): default theme initial configuration
d23e27c chore(package): add gatsby-plugin-jss
a166099 chore(styles): add Roboto font family
e150a23 chore(package): add gatsby-plugin-google-fonts
ff7c9c7 chore(package): add and configure ESLint
e7141a1 chore(package): switch extension of React JS files to .jsx
8a3a62b chore(package): run Prettier on src and gatsby-* files
8985d2a chore(package): add some default Prettier settings
9039bde chore(package): update Gatsby to 2.24.42 to fix gatsbyjs/gatsby#26345
1051910 chore(package): initial bootstrap from https://github.com/gatsbyjs/gatsby-starter-default.git
danithecake added a commit to buninux/buninux.github.io that referenced this issue Aug 25, 2020
788cce9 chore(package): add path prefix to correct hosting demo on buninux.github.io/frames
578e005 improve(pages): update theming page with Sidebar and initial content
b54393b improve(components): initial ThemeColorPicker implementation
1f883c1 chore(components): wrap ComingSoon content with Main component
fa1d889 improve(components): initial Main implementation
0cd2672 improve(components): intitial Sidebar implementation
bb46f2a improve(component): update Layout structure and styles as page content container
d1d3ef0 improve(styles): appropriate global styles for native HTML elements
2d86938 chore(components): redefine Header border style as JSS array
87779e6 fix(styles): swap theme foreground and background colors
a3d0f4b improve(components): clean up Header styles and add active link state
dad8fb4 chore(package): add classnames dependency
3afd7b4 improve(styles): remove redundant body margin
155bf91 chore(components): clean up Layout component
76f0a14 refactor(pages): initial pages structure config
7ec4820 chore(pages): initial Theming page
f7ad9f7 chore(components): initial Coming Soon page component
cc5cc69 improve(components): initial Header styling
11f6b9a improve(components): initial Layout styling
1c01cea chore(package): capitalize components files names
3580854 chore(styles): default theme initial configuration
d23e27c chore(package): add gatsby-plugin-jss
a166099 chore(styles): add Roboto font family
e150a23 chore(package): add gatsby-plugin-google-fonts
ff7c9c7 chore(package): add and configure ESLint
e7141a1 chore(package): switch extension of React JS files to .jsx
8a3a62b chore(package): run Prettier on src and gatsby-* files
8985d2a chore(package): add some default Prettier settings
9039bde chore(package): update Gatsby to 2.24.42 to fix gatsbyjs/gatsby#26345
1051910 chore(package): initial bootstrap from https://github.com/gatsbyjs/gatsby-starter-default.git
danithecake added a commit to buninux/buninux.github.io that referenced this issue Aug 25, 2020
788cce9 chore(package): add path prefix to correct hosting demo on buninux.github.io/frames
578e005 improve(pages): update theming page with Sidebar and initial content
b54393b improve(components): initial ThemeColorPicker implementation
1f883c1 chore(components): wrap ComingSoon content with Main component
fa1d889 improve(components): initial Main implementation
0cd2672 improve(components): intitial Sidebar implementation
bb46f2a improve(component): update Layout structure and styles as page content container
d1d3ef0 improve(styles): appropriate global styles for native HTML elements
2d86938 chore(components): redefine Header border style as JSS array
87779e6 fix(styles): swap theme foreground and background colors
a3d0f4b improve(components): clean up Header styles and add active link state
dad8fb4 chore(package): add classnames dependency
3afd7b4 improve(styles): remove redundant body margin
155bf91 chore(components): clean up Layout component
76f0a14 refactor(pages): initial pages structure config
7ec4820 chore(pages): initial Theming page
f7ad9f7 chore(components): initial Coming Soon page component
cc5cc69 improve(components): initial Header styling
11f6b9a improve(components): initial Layout styling
1c01cea chore(package): capitalize components files names
3580854 chore(styles): default theme initial configuration
d23e27c chore(package): add gatsby-plugin-jss
a166099 chore(styles): add Roboto font family
e150a23 chore(package): add gatsby-plugin-google-fonts
ff7c9c7 chore(package): add and configure ESLint
e7141a1 chore(package): switch extension of React JS files to .jsx
8a3a62b chore(package): run Prettier on src and gatsby-* files
8985d2a chore(package): add some default Prettier settings
9039bde chore(package): update Gatsby to 2.24.42 to fix gatsbyjs/gatsby#26345
1051910 chore(package): initial bootstrap from https://github.com/gatsbyjs/gatsby-starter-default.git
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet