MD SHAYON
MD SHAYON

Reputation: 8063

How To Fix Gatsby Develop Error: Cannot find module 'gatsby-cli/lib/reporter'?

Getting problem with Gatsby. It's is showing Error: Cannot find module 'gatsby-cli/lib/reporter' in command prompt when I am running gatsby develop . How can I solve it please answer.

Error Message

E:\JavaScript\gatsby-js> gatsby develop
success open and validate gatsby-configs - 0.008 s
error Error in "E:\JavaScript\gatsby-js\node_modules\gatsby-source-filesystem\gatsby-node.js":


  Error: Cannot find module 'gatsby-cli/lib/reporter'
  Require stack:
  - E:\JavaScript\gatsby-js\node_modules\gatsby-source-filesystem\utils.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby-source-filesystem\create-file-node.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby-source-filesystem\gatsby-node.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\bootstrap\resolve-module-exports.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\bootstrap\load-plugins\validate.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\bootstrap\load-plugins\load.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\bootstrap\load-plugins\index.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\bootstrap\index.js
  - E:\JavaScript\gatsby-js\node_modules\gatsby\dist\commands\develop.js
  - C:\Users\Shayon\AppData\Roaming\npm\node_modules\gatsby-cli\lib\create-cli.js
  - C:\Users\Shayon\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js

  - loader.js:623 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:623:15

  - loader.js:527 Function.Module._load
    internal/modules/cjs/loader.js:527:27

  - loader.js:681 Module.require
    internal/modules/cjs/loader.js:681:19

  - v8-compile-cache.js:159 require
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - utils.js:15 Object.<anonymous>
    [gatsby-js]/[gatsby-source-filesystem]/utils.js:15:18

  - v8-compile-cache.js:178 Module._compile
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:785 Object.Module._extensions..js
    internal/modules/cjs/loader.js:785:10

  - loader.js:641 Module.load
    internal/modules/cjs/loader.js:641:32

  - loader.js:556 Function.Module._load
    internal/modules/cjs/loader.js:556:12

  - loader.js:681 Module.require
    internal/modules/cjs/loader.js:681:19

  - v8-compile-cache.js:159 require
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - create-file-node.js:7 Object.<anonymous>
    [gatsby-js]/[gatsby-source-filesystem]/create-file-node.js:7:18

  - v8-compile-cache.js:178 Module._compile
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:785 Object.Module._extensions..js
    internal/modules/cjs/loader.js:785:10

  - loader.js:641 Module.load
    internal/modules/cjs/loader.js:641:32

  - loader.js:556 Function.Module._load
    internal/modules/cjs/loader.js:556:12

  - loader.js:681 Module.require
    internal/modules/cjs/loader.js:681:19

  - v8-compile-cache.js:159 require
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:159:20

  - gatsby-node.js:12 Object.<anonymous>
    [gatsby-js]/[gatsby-source-filesystem]/gatsby-node.js:12:19

  - v8-compile-cache.js:178 Module._compile
    [gatsby-js]/[v8-compile-cache]/v8-compile-cache.js:178:30

  - loader.js:785 Object.Module._extensions..js
    internal/modules/cjs/loader.js:785:10

  - loader.js:641 Module.load
    internal/modules/cjs/loader.js:641:32


⠋ load plugins

Upvotes: 7

Views: 9855

Answers (4)

Harsh
Harsh

Reputation: 1

Mine one is fixed only by deleting only node_modules followed by reinstalling using , "npm install"

Upvotes: -1

Rajitha
Rajitha

Reputation: 47

Remove node-modules and package-lock.json, and reinstall them by running npm install. Fixed mine!✔️

Upvotes: 3

Benjamin C
Benjamin C

Reputation: 351

I experienced the same issue as you. Install the missing module to your project with:

npm install --save gatsby-cli

Solution is from https://github.com/gatsbyjs/gatsby/issues/4131

Upvotes: 20

Umbro
Umbro

Reputation: 2204

As an immediate workaround you can use yarn instead of npm

rm -rf node_modules
yarn
gatsby develop

Solution here: https://github.com/gatsbyjs/gatsby/issues/14875

Upvotes: 3

Related Questions