gatsby: [gatsby-cli] Error: Cannot find module '../ink/components/progress-bar'
Description
After updating “gatsby-cli”: “^2.10.3”, it throws the following error.
Error: Cannot find module '../ink/components/progress-bar'
Steps to reproduce
Update gatsby-cli to ^2.10.3 and run gatsby develop or any other gatsby ... command
Expected result
Gatsby CLI should run every gatsby ... command as usual instead of breaking.
Actual result
▶ gatsby develop
/usr/local/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error: Cannot find module '../ink/components/progress-bar'
Require stack:
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/loggers/ink/cli.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/loggers/ink/index.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js
- /usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js
- /usr/local/lib/node_modules/gatsby-cli/lib/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/lib/reporter/loggers/ink/cli.js:22:20)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/loggers/ink/cli.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/loggers/ink/index.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js',
'/usr/local/lib/node_modules/gatsby-cli/lib/index.js'
]
}
Environment
Unfortunately gatsby info --clipboard doesn’t work either.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 51
- Comments: 46 (7 by maintainers)
Links to this issue
Commits related to this issue
- modify gatsby & gatsby-cli versions to avoid https://github.com/gatsbyjs/gatsby/issues/22109 — committed to ProjectWaves/waves-site by AdamBouhmad 4 years ago
- Update gatsby to solve issue https://github.com/gatsbyjs/gatsby/issues/22109 — committed to HugoHermanWilson/hugohermanwilson.com by SarahFrench 4 years ago
I’ve identified this and have a hotfix coming. No worries @herecydev, but thank you!
OOF! So sorry about this everyone… I’ve released a new version that fixes this. Please update.
Again, I’m so sorry for the damage this caused in lost time and hair-pulling! 😢 💜
@mmafe please make sure that gatsby and gatsby-cli in package.json as following
"gatsby": "^2.19.34", "gatsby-cli": "^2.10.4",@blainekasten Sorry! Can we reopen this issue? I’m still receiving the same error (similar to @danoszz) with the gatsby 2.19.34 and gatsby-cli 2.10.4. 😃
@abdokouta The fix has been merged, if I was a betting man I would say a release would be available imminently
Adding
gatsby-clito my package.json fixed my netlify build, thanks!After running
npm update gatsby. It fixed the netlify problem for me and built correctlyAfter 4.5 hours of debugging, I’m thrilled that this thread is the thing that finally helped me fix my failing Netlify deploy. I fixed it by updating Gatsby
npm update gatsbyon local, then pushing the update.hm, strange
I fixed it by updating gatsby
npm update gatsbyWent thru 2.10.3, 2.10.2 and 2.10.1, all have same error (and does not work). Would be cool if you could tag some “stable” version with “stable” tag 😄
Hey, @blainekasten Getting This error tried every method mentioned in this thread.
Had the same issue (
Error: Cannot find module 'ink') with"gatsby": "^2.19.14", "gatsby-cli": "^2.12.46",.Fixed it by deleting
node_modulesandpackage-lock.jsonand relocking with$ npm install.Sorry friends! And thank you for reporting. I’ve got a fix up here. I’ll try to get a release out today if I can get it merged.
Unfortunately,
"gatsby-cli": "^2.10.3"is still throwing the same error on everygatsby ...command. Even after reinstalling global and localnode_modules.@blainekasten I fixed it by including gatsby-cli in my package.lock. I’ll try to run a build later today without it included and with @mskrip’s solution instead to see what happens.
@blainekasten @rennehir I’ve fixed issue by installing optional deps, because as for now I’ve been using
npm i --no-optionalon CI environment, but currently for Gatsby it is not possible.If
inkis required for build process, I think it should not be markedoptional.I’m also experiencing this when building my site on Netlify. I have cleared cache etc on Netlify. Locally the build works with no problems.
gatsby-cli@2.12.35 gatsby@2.20.19 Netlify build image: Ubuntu Xenial 16.04 (default)
Somehow, I had to manually remove
/usr/local/bin/gatsby,/usr/local/lib/node_modules/gatsbyand/usr/local/lib/node_modules/gatsby-cliand after runningnpm install -g gatsby-clito get it all working again.So the fix then implies, that globally and locally (in package.json as direct dependency, to be on safe side) should be kept in sync?
Worst timing ever to have an version upgrade for me! Works now. Thanks @blainekasten !
But from an architectural perspective, gatsby-cli, that is needed to be installed globally, is also dependency of gatsby (used a dependency, as this is gatsby project). So, if that’s the case, then basically gatsby is the one “defining” the version of gatsby-cli, NOT the one you install globally?
This version is working for me on a new site. Thanks