MoonshotAI / MoonshotAI/kimi-code
[Docs] npm ≥11 allow-scripts blocks kimi-code postinstall & node-pty build by default; install docs should mention --allow-scripts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
环境
- macOS 15.6(darwin 25.6.0,arm64),node v25.9.0,npm 11.19.0
现象
按文档执行 npm install -g @moonshot-ai/kimi-code@latest,安装"成功"(exit 0),只有几行容易被忽略的 warn:
npm warn install-scripts 2 packages have install scripts not yet covered by allowScripts:
npm warn install-scripts @moonshot-ai/kimi-code@0.43.0 (postinstall: node scripts/postinstall.mjs)
npm warn install-scripts node-pty@1.1.0 (install: node scripts/prebuild.js || node-gyp rebuild; postinstall: node scripts/post-install.js)
npm warn install-scripts Run `npm install -g --allow-scripts=@moonshot-ai/kimi-code,node-pty` to allow these scripts once, or `npm config set allow-scripts=@moonshot-ai/kimi-code,node-pty --location=user` to allow these scripts for all global installs.
结果:kimi-code 的 postinstall(旧 CLI 清理/接管逻辑)与 node-pty 的原生模块安装脚本都被静默跳过。CLI 本身仍能启动(0.43.0 的 npm shim 不依赖 postinstall 即可运行),但接管逻辑因此失效,node-pty 未构建对终端相关功能的影响也没有任何向用户的提示。目前 README / 官方 FAQ 中没有关于 npm allow-scripts 机制的任何说明。
建议
-
安装文档补充新版 npm 默认拦截 lifecycle scripts 的说明,给出推荐安装命令:
npm install -g --allow-scripts=@moonshot-ai/kimi-code,node-pty @moonshot-ai/kimi-code@latest -
或在 kimi 启动时 /
kimi doctor中检测 node-pty 原生绑定缺失、postinstall 未执行等状态,主动给出修复提示,而不是仅依赖安装时一闪而过的 npm warn。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Check the README and official FAQ installation sections first. Document npm 11's lifecycle-script blocking and the recommended --allow-scripts command for kimi-code and node-pty. Done means the documented global install addresses the reported postinstall and native-module issue and clearly explains the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100