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 module not found after updating to latest Gatsby verison

See original GitHub issue

Description

It all started after I updated Gatsby to the latest version in my project that I would receive an error saying the Gatsby-cli module could not be found (error written below) after running gatsby develop After a lot of troubleshooting, I tried creating a new gatsby site with a fresh install of npm install -g gatsby-cli and npm install -g gatsby, but I was getting the same error. Even after running gatsby -v I get the same error.

Steps to reproduce

Update to latest Gatsby

Expected result

Gatsby-cli should be installed

Actual result

C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53 throw ex; ^

Error: Package exports for ‘C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\clipboardy’ do not define a ‘.’ subpath at resolveExports (internal/modules/cjs/loader.js:419:17) at Function.Module._findPath (internal/modules/cjs/loader.js:492:20) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27) at Function.Module._load (internal/modules/cjs/loader.js:693:27) at Module.require (internal/modules/cjs/loader.js:864:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (C:\Users\ctsyg\AppData\Roaming\npm\node_modules\gatsby-cli\lib\create-cli.js:24:20) at Module._compile (internal/modules/cjs/loader.js:971:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1011:10) at Module.load (internal/modules/cjs/loader.js:822:32) { code: ‘MODULE_NOT_FOUND’ }

Environment

Same as above

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
cpinnixcommented, Apr 1, 2020

Painful. I can validate this is a node version issue. Upgraded to 13.12.0 and the problem is resolved.

2reactions
d0x1ncommented, Jun 2, 2020

installed the latest version of node (14.3.0) and apparently works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module '..\node_modules\gatsby\dist ...
1 Answer 1 · Run the following: npm install --save gatsby-cli · If you have many audit warnings before the previous command, run:...
Read more >
Troubleshooting Common Errors
To fix this, you'll need to update all Gatsby plugins in the current project that depend on the sharp package. Here's a list...
Read more >
gatsby-cli
Gatsby command-line interface for creating new sites and running Gatsby commands. Latest version: 5.3.1, last published: 13 days ago.
Read more >
Gatsby Changelog | 5.3.0
When using the Slices Optimization on Gatsby Cloud, build time decreases by 78% for code updates compared to No Slices on Gatsby Cloud....
Read more >
Gatsby
This error occurs when plugins are being used that have not been installed. To remedy this, do an npm install -g . This...
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