Bug Description
lark-cli update only recognizes two installation sources according to --help:
npm install: runs npm install -g @larksuite/cli@<version>
manual/other: shows GitHub Releases download URL
When @larksuite/cli is installed globally via pnpm, lark-cli update misdetects it as an npm installation and runs npm install -g @larksuite/cli@<version>. This installs a second copy under npm global (~/.nvm/.../bin/lark-cli) instead of updating the pnpm-managed copy (~/Library/pnpm/bin/lark-cli).
Environment
lark-cli version: 1.0.60 (installed via pnpm add -g @larksuite/cli)
pnpm version: 11.1.1
- Node.js version:
26.1.0 (via nvm)
- OS: macOS
Reproduction
- Install globally via pnpm:
pnpm add -g @larksuite/cli@1.0.44
- Run the self-updater:
Actual result
- A new copy of
lark-cli is installed under npm global, e.g. ~/.nvm/versions/node/v26.1.0/bin/lark-cli.
- The pnpm-managed copy remains at the old version.
which -a lark-cli now returns two different paths with potentially different versions.
Expected result
lark-cli update should detect the actual package manager (pnpm) and run the equivalent upgrade command, e.g.:
pnpm add -g @larksuite/cli@<version>
Alternatively, it should at least fall back to manual/other and show the GitHub release URL instead of silently switching package managers.
Root cause analysis
The detection logic appears to check whether the binary path lies under node_modules/@larksuite/cli/bin/. Since both npm and pnpm install the package into a node_modules/@larksuite/cli layout, pnpm installations satisfy the same path pattern and are incorrectly classified as npm installations.
Evidence from the binary strings:
npm install -g %s@%s
Detects the installation method automatically:
- npm install: runs npm install -g @larksuite/cli@<version>
- manual/other: shows GitHub Releases download URL
There are no pnpm add -g or pnpm install -g branches.
Impact
- Users who prefer pnpm end up with duplicate, inconsistent
lark-cli installations.
- The
lark-cli update command cannot be trusted to keep the active binary up to date when pnpm is used.
- PATH order determines which version runs, leading to confusing behavior across shell sessions and VS Code extension host environments.
Workaround
For pnpm users, manually upgrade instead of using lark-cli update:
pnpm add -g @larksuite/cli@<version>
Then sync skills separately if needed:
pnpm dlx skills add larksuite/cli -y -g
Bug Description
lark-cli updateonly recognizes two installation sources according to--help:npm install: runsnpm install -g @larksuite/cli@<version>manual/other: shows GitHub Releases download URLWhen
@larksuite/cliis installed globally via pnpm,lark-cli updatemisdetects it as an npm installation and runsnpm install -g @larksuite/cli@<version>. This installs a second copy under npm global (~/.nvm/.../bin/lark-cli) instead of updating the pnpm-managed copy (~/Library/pnpm/bin/lark-cli).Environment
lark-cliversion:1.0.60(installed viapnpm add -g @larksuite/cli)pnpmversion:11.1.126.1.0(via nvm)Reproduction
Actual result
lark-cliis installed under npm global, e.g.~/.nvm/versions/node/v26.1.0/bin/lark-cli.which -a lark-clinow returns two different paths with potentially different versions.Expected result
lark-cli updateshould detect the actual package manager (pnpm) and run the equivalent upgrade command, e.g.:Alternatively, it should at least fall back to
manual/otherand show the GitHub release URL instead of silently switching package managers.Root cause analysis
The detection logic appears to check whether the binary path lies under
node_modules/@larksuite/cli/bin/. Since both npm and pnpm install the package into anode_modules/@larksuite/clilayout, pnpm installations satisfy the same path pattern and are incorrectly classified as npm installations.Evidence from the binary strings:
There are no
pnpm add -gorpnpm install -gbranches.Impact
lark-cliinstallations.lark-cli updatecommand cannot be trusted to keep the active binary up to date when pnpm is used.Workaround
For pnpm users, manually upgrade instead of using
lark-cli update:Then sync skills separately if needed: