question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(gatsby-cli): Cannot find module 'react'

See original GitHub issue

Try to start tutorial with Gatsby.

Description

D:\formation>gatsby
C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

Error: Cannot find module 'react'
Require stack:
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\node_modules\gatsby-recipes\dist\index.js
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\node_modules\gatsby-cli\lib\recipes.js
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\node_modules\gatsby-cli\lib\create-cli.js
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\node_modules\gatsby-cli\lib\index.js
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\dist\bin\gatsby.js
- C:\Users\jlouis.JLG.000\AppData\Roaming\npm\node_modules\gatsby\cli.js

Steps to reproduce

Remove nodeJS from my Windows 10 computer:

  • Add or Remove Programs, then remove node.
  • Clean the %APPDATA%/npm and %APPDATA%/npm-cache.

Install nodejs v14.11.0 with all defaulted options.

Then

npm i -g gatsby
gatsby

Expected result

According the doc, I see a help screen…

Actual result

…But in fact, I get an error stack trace as described above.

Environment

Run gatsby info --clipboard in your project directory and paste the output here. Sorry I cannot, I get the error stacktrace.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
piehcommented, Sep 16, 2020

As a workaround until fix gets merged and published - please do npm install -g gatsby-cli@2.12.97 to use 1 version before the problem

1reaction
MrDeLeTeDcommented, Sep 17, 2020

Thanks for the QuickFix. Is it possible to add CIT to the pipeline to be sure that the release still working ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby - cannot find module react - Stack Overflow
but I am getting this while I want to create a new project. I am getting this error even with this command: gatsby....
Read more >
Error: Cannot find module 'react' - after installing Plugin · Issue ...
here is got the error: ERROR There was a problem loading the local develop command. Gatsby may not be installed. Perhaps you need...
Read more >
Error: Cannot find module "react" in Gatsby - Scott McCulloch
This issue occured after I added a new plugin to handle gatsby redirects. The issue appears because of conflicting versions of React and...
Read more >
Gatsby, fix the "cannot find module gatsby-cli/lib/reporter" error
I created a site using Gatsby and I ran gatsby develop to start a local server. After a few searches across GitHub and...
Read more >
Error: Cannot find module 'gatsby-plugin-utils/polyfill-remote-file'
Error : Cannot find module 'gatsby-plugin-utils/polyfill-remote-file' · $ NODE_OPTIONS= · /Users/esausilva/Development/Projects/andreasilva-design/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found