Gatsby: Error: Cannot find module 'gatsby-telemetry'

Created on 16 Dec 2020  路  6Comments  路  Source: gatsbyjs/gatsby

Description

After the 2.29.0 update, gatsby develop & gatsby build throws an error stating Cannot find module 'gatsby-telemetry'. This occurs on both CI (Github Actions) and locally. Tried a fresh install of node_modules but to no avail.


Stack trace

> [email protected] develop C:\Code\portfolio
> gatsby develop -H 0.0.0.0

success open and validate gatsby-configs - 0.540s

Error in
"C:\Code\portfolio\node_modules\gatsby-plugin-page-creator\gatsby-node.js":
Cannot find module 'gatsby-telemetry'
Require stack:
- C:\Code\portfolio\node_modules\gatsby-plugin-page-creator\gatsby-node.js
- C:\Code\portfolio\node_modules\gatsby\dist\bootstrap\resolve-module-exports.js
- C:\Code\portfolio\node_modules\gatsby\dist\bootstrap\load-plugins\validate.js
- C:\Code\portfolio\node_modules\gatsby\dist\bootstrap\load-plugins\load.js
- C:\Code\portfolio\node_modules\gatsby\dist\bootstrap\load-plugins\index.js
- C:\Code\portfolio\node_modules\gatsby\dist\services\initialize.js
- C:\Code\portfolio\node_modules\gatsby\dist\services\index.js
- C:\Code\portfolio\node_modules\gatsby\dist\state-machines\develop\services.js
- C:\Code\portfolio\node_modules\gatsby\dist\state-machines\develop\index.js
- C:\Code\portfolio\node_modules\gatsby\dist\commands\develop-process.js
- C:\Code\portfolio\.cache\tmp-16568-jQdwdvLPA6mq

Steps to reproduce

Unfortunately, I'm not able to reproduce the issue. I tried on Codesandbox.

Expected result

gatsby develop & gatsby build should succeed without errors.

Actual result

gatsby develop & gatsby build throws cannot find module 'gatsby-telemetry'.

Environment

System:
  OS: Windows 10 10.0.19042
  CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
Binaries:
  Node: 14.15.0 - C:\Program Files\nodejs\node.EXE
  npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
Languages:
  Python: 3.9.0 - /c/Users/D. Kasi Pavan Kumar/AppData/Local/Programs/Python/Python39/python
Browsers:
  Chrome: 87.0.4280.88
  Edge: Spartan (44.19041.423.0), Chromium (87.0.664.60)
npmPackages:
  gatsby: ^2.29.0 => 2.29.0
  gatsby-image: ^2.8.0 => 2.8.0
  gatsby-plugin-manifest: ^2.8.0 => 2.8.0
  gatsby-plugin-offline: ^3.6.0 => 3.6.0
  gatsby-plugin-react-helmet: ^3.6.0 => 3.6.0
  gatsby-plugin-sass: ^2.7.0 => 2.7.0
  gatsby-plugin-sharp: ^2.11.0 => 2.11.0
  gatsby-plugin-sitemap: ^2.8.0 => 2.8.0
  gatsby-remark-autolink-headers: ^2.7.0 => 2.7.0
  gatsby-remark-copy-linked-files: ^2.6.0 => 2.6.0
  gatsby-remark-images: ^3.7.1 => 3.7.1
  gatsby-remark-prismjs: ^3.9.0 => 3.9.0
  gatsby-remark-relative-images: ^2.0.2 => 2.0.2
  gatsby-source-filesystem: ^2.7.0 => 2.7.0
  gatsby-transformer-remark: ^2.12.0 => 2.12.0
  gatsby-transformer-sharp: ^2.8.0 => 2.8.0
npmGlobalPackages:
  gatsby-cli: 2.16.0
needs reproduction bug

Most helpful comment

Just to clarify - above is dependency of gatsby, so in this case this means fix pulished in [email protected] ;)

All 6 comments

For a workaround, npm i gatsby-telemetry solves the issue.

Hi!

I've tried this with npm init gatsby to create a new site, start it with gatsby develop and it's all fine. Have you removed .cache, public, a lock file (e.g. package-lock.json) and node_modules and tried again?

Greetings, thanks for your response.

Yes, I have tried removing .cache, public and node_modules but to no avail.
For temporary workaround, I have added the gatsby-telemetry package as a devDependency.

To be more specific, the issue arised after updating gatsby-plugin-sharp to 2.11.0 and not gatsby.

Just to clarify - above is dependency of gatsby, so in this case this means fix pulished in [email protected] ;)

Thank you, the problem is fixed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

benstr picture benstr  路  3Comments

hobochild picture hobochild  路  3Comments

brandonmp picture brandonmp  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments