gatsby: Error: Cannot find module 'joi'

Description

Gatsby immediately throws an exception.

Steps to reproduce

gatsby

Expected result

Usage message, etc.

Actual result

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

Error: Cannot find module 'joi'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\johnp\AppData\Roaming\npm\node_modules\gatsby-cli\lib\structured-errors\construct-error.js:3:13)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

Environment

gatsby command doesn’t work period. npm version 6.9.2, i’ve tried uninstalling and reinstalling gatsby etc.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Published gatsby@2.11.3, please update and let us know in case it didn’t do the trick

Hello folks!

We’re aware — thanks for letting us know, and sorry for this inconvenience!

The fix is in #15221, and will be published as soon as the unit tests pass.

Everything working 💯 node v11.3.0 npm 6.9.2 gatsby-cli 2.7.6 gatsby 2.11.3

Hi folks!

I updated every part, which was mentioned in the comments. Now I run on:

  • node v10.16.0 (it the recommended LTS version)
  • npm 6.9.2
  • gatsby@2.11.3
  • gatsby-cli@2.7.6

I’m on a Window 10 PC.

However, I get this error message whenever I type gatsby develop

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

Error: Cannot find module ‘joi’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (C:\Users\Lukas\AppData\Roaming\npm\node_modules\gatsby-cli\lib\structured-errors\construct-error.js:3:13) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)

I fear, this is the same behaviour as before the update. What do I have to do to to get my Gatsby App up again?