React GatsbyのCannot find module 'gatsby-cli/lib/reporter'の解決法
auです。
React GaysbyとmicroCMSを使ってheadlessCMSなサイトを作ってみようと思ってしょっぱなつまずきました。
プロジェクトを作っただけなのになぜエラーが...
やったこと
1. 新しくプロジェクト立ち上げ
yarnとnpmの立ち上げはnpmを選びました。
gatsby new プロジェクト名
2. develop環境で実行
gatsby develop
エラー文
Error: Cannot find module 'gatsby-cli/lib/reporter' Require stack: - /Users/USERNAME/PROJECT/node_modules/gatsby-plugin-page-creator/is-v alid-collection-path-implementation.js - /Users/USERNAME/PROJECT/node_modules/gatsby-plugin-page-creator/crea te-pages-from-collection-builder.js - /Users/USERNAME/PROJECT/node_modules/gatsby-plugin-page-creator/crea te-page-wrapper.js - /Users/USERNAME/PROJECT/node_modules/gatsby-plugin-page-creator/gats by-node.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/bootstrap/resolve-m odule-exports.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/bootstrap/load-plug ins/validate.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/bootstrap/load-plug ins/load.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/bootstrap/load-plug ins/index.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/services/initialize .js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/services/index.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/state-machines/deve lop/services.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/state-machines/deve lop/index.js - /Users/USERNAME/PROJECT/node_modules/gatsby/dist/commands/develop-pr ocess.js - /Users/USERNAME/PROJECT/.cache/tmp-2756-aOKAMHldQWx2