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 recipes gives me Error: No valid exports main found for '/Users/John/node_modules/@urql/core'

See original GitHub issue

Description

When running gatsby recipes I get the following:

 www % gatsby recipes
/Users/John/.nvm/versions/node/v13.5.0/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: No valid exports main found for '/Users/John/node_modules/@urql/core'
    at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/John/node_modules/urql/dist/urql.js:1:12)
    at Module._compile (internal/modules/cjs/loader.js:1139:30) {
  code: 'MODULE_NOT_FOUND'
}

Steps to reproduce

  1. npm install -g gatsby-cli@latest
  2. npm install gatsby@latest
  3. gatsby new www https://github.com/gatsbyjs/gatsby-starter-hello-world
  4. cd www
  5. gatsby recipes

Environment

System: OS: macOS 10.15.4 CPU: (12) x64 Intel® Core™ i7-8750H CPU @ 2.20GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 13.5.0 - ~/.nvm/versions/node/v13.5.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.2 - ~/.nvm/versions/node/v13.5.0/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 80.0.3987.163 Safari: 13.1 npmPackages: gatsby: ^2.20.12 => 2.20.12 npmGlobalPackages: gatsby-cli: 2.11.9

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kittencommented, Jun 19, 2020

@amirAHD77 either upgrade to node 14 or downgrade to node 12, and/or upgrade @urql/core if you’re on one of the affected versions (which can still be the case due to caching / odd version resolutions sometimes) https://github.com/gatsbyjs/gatsby/issues/24514#issuecomment-634435861

0reactions
amirAHD77commented, Jun 19, 2020

same issue .how can i fix it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix “Error: No valid exports main found for ... - Dev Genius
The solution. After some digging around, I found the suggestion to update to Node 14.5. There are many ways to do this; I...
Read more >
How do I fix the error "Error: no valid exports main found" on ...
I am not able to run react app on my windows 7 OS. I have npm version 6.13.4, node version 13.6.0 installed. It...
Read more >
Fixing Create React App Error: No valid exports main found
If you're getting “No valid exports main found” in your Create React App, trying to install the latest version of NodeJS.
Read more >
HOW TO SOLVE THE NO VALID EXPORTS ERROR IN ...
Recently while running the sequelize-cli init command, I ran into an error. The error message was something like export not found.
Read more >
How to fix “Error: No valid exports main found ... - Godwill Barasa
On 12th May, as I was trying to “npm run dev” a react application that I hadn't pulled from the master branch in...
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