tslib is in devDependencies → Cannot find module 'tslib' on global install
Repo: contentstack/cli — package @contentstack/cli
@contentstack/cli require("tslib") at runtime (e.g. lib/help.js) but lists tslib in
devDependencies, not dependencies. Consumers don't get devDependencies, so tslib is never
installed and the CLI errors out on install.
Repro:
pnpm add -g @contentstack/cli
csdx --help
→ ends with [MODULE_NOT_FOUND] ... @contentstack/cli/lib/help.js: Cannot find module 'tslib'.
Confirmed from the registry:
$ curl -s https://registry.npmjs.org/@contentstack/cli/1.64.0 | jq '{dep:.dependencies.tslib, dev:.devDependencies.tslib}'
{ "dep": null, "dev": "^2.8.1" }
You don't hit it in dev because .npmrc has shamefully-hoist=true, which hoists tslib into a
resolvable spot — but that's not published, so it doesn't help users. npm users also mostly dodge
it via flat node_modules. Not OS-specific.
Fix: move tslib to dependencies in packages/contentstack/package.json (or set
importHelpers: false in tsconfig so no runtime tslib is needed). Worth checking the other
packages/* plugins for the same misplacement.
Note: a global install also throws a larger wall of tslib errors from the @contentstack/cli-launch
plugin — that's a separate package (contentstack/launch-cli) with the same bug; filed there too.
Env: cli 1.64.0, @oclif/core 4.11.11, pnpm 11.9.0, node 23.9.0.
tslibis in devDependencies →Cannot find module 'tslib'on global installRepo: contentstack/cli — package
@contentstack/cli@contentstack/clirequire("tslib")at runtime (e.g.lib/help.js) but liststslibindevDependencies, not dependencies. Consumers don't get devDependencies, so
tslibis neverinstalled and the CLI errors out on install.
Repro:
→ ends with
[MODULE_NOT_FOUND] ... @contentstack/cli/lib/help.js: Cannot find module 'tslib'.Confirmed from the registry:
You don't hit it in dev because
.npmrchasshamefully-hoist=true, which hoiststslibinto aresolvable spot — but that's not published, so it doesn't help users. npm users also mostly dodge
it via flat node_modules. Not OS-specific.
Fix: move
tslibtodependenciesinpackages/contentstack/package.json(or setimportHelpers: falsein tsconfig so no runtimetslibis needed). Worth checking the otherpackages/*plugins for the same misplacement.Note: a global install also throws a larger wall of
tsliberrors from the@contentstack/cli-launchplugin — that's a separate package (contentstack/launch-cli) with the same bug; filed there too.
Env: cli 1.64.0, @oclif/core 4.11.11, pnpm 11.9.0, node 23.9.0.