Ask questions[gatsby-telemetry] error: src/postinstall.js not found in Linux environments
In a Linux instance, Gatsby CLI is breaking currently because it doesn't find src/postinstall.js from gatsby-telemetry when running gatsby new with NPX.
npx gatsby new .Should just run
Error:
internal/modules/cjs/loader.js:628
throw err;
^
Error: Cannot find module '/root/.npm/_npx/17/lib/node_modules/gatsby/node_modules/core-js/scripts/postinstall'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
internal/modules/cjs/loader.js:628
throw err;
^
Error: Cannot find module '/root/.npm/_npx/17/lib/node_modules/gatsby/node_modules/core-js-pure/scripts/postinstall'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
internal/modules/cjs/loader.js:628
throw err;
^
Error: Cannot find module '/root/.npm/_npx/17/lib/node_modules/gatsby/node_modules/gatsby-telemetry/src/postinstall.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node src/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-08-01T21_57_39_926Z-debug.log
Install for [ 'gatsby@latest' ] failed with code 1
This may be an issue with this commit: https://github.com/gatsbyjs/gatsby/commit/9d32f3cf45a8155018c4fae0d5ad80f0e195a348
Run gatsby info --clipboard in your project directory and paste the output here.
Answer questions
lannonbr
@jamo Yeah it was a colleague of mine that was getting stuck with this, he did npm i -g gatsby-cli in the docker container he was working in to get around this issue for the time being.
Related questions