-
Notifications
You must be signed in to change notification settings - Fork 70
Description
After a fresh install, contentful-cli fails at startup with a missing internal module from contentful-migration.
Environment
- Node: 24.13.0 (also observed in GitHub Actions runner)
- OS: Windows (also reproduced on GitHub Actions Linux runner)
- Install method: npm install (un-pinned)
Steps to reproduce
npm i contentful-cli
npm ls --depth=2 contentful-cli contentful-migrationObserved:
contentful-cli@3.10.2- depends on
contentful-migration@4.31.6
- depends on
Run any contentful command (or reproduce directly by requiring the path the CLI attempts to load):
node -e "require('contentful-migration/built/bin/cli')"Expected
contentful commands work after install.
Actual
Crash with:
Error: Cannot find module 'contentful-migration/built/bin/cli'
Notes / analysis
It appears contentful-cli@3.10.2 is requiring an internal path:
contentful-migration/built/bin/cli
…but that path does not exist in contentful-migration@4.31.6.
In contentful-migration@4.31.6, the CLI entrypoint is defined via the package bin field:
{ "contentful-migration": "./bin/contentful-migration" }Package root:
node_modules/contentful-migration
Resolved CLI entrypoint:
./bin/contentful-migration
Example absolute path (Windows):
node_modules\contentful-migration\bin\contentful-migration
There is no built/bin/cli in contentful-migration@4.31.6, so any code doing:
require('contentful-migration/built/bin/cli')will fail with MODULE_NOT_FOUND.
This also explains why CI began failing without repo changes: an unpinned install started resolving to a newer contentful-migration version whose internal layout no longer matches what contentful-cli@3.10.2 expects.