Fix: Resolve 'program not found' error for lean-spec ui/mcp commands on Windows#158
Open
GoldTest wants to merge 1 commit intocodervisor:mainfrom
Open
Fix: Resolve 'program not found' error for lean-spec ui/mcp commands on Windows#158GoldTest wants to merge 1 commit intocodervisor:mainfrom
GoldTest wants to merge 1 commit intocodervisor:mainfrom
Conversation
…on Windows - Add missing dependencies to lean-spec package (@leanspec/ui, @leanspec/http-server, @leanspec/mcp) - Improve error handling in leanspec-ui.js: use process.execPath instead of 'node' string for cross-platform compatibility - Fix npm v10 compatibility: replace deprecated npx with 'npm exec' in ui.rs and mcp.rs - Add unit tests for npm command generation - Add validation checks for HTTP server path resolution This fixes the issue where 'lean-spec ui' and 'lean-spec mcp' commands fail with 'program not found' when installed globally via npm. Fixes: Windows 11 users reporting npm 10.8.1 + Node v24.11.1 compatibility issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
修复Windows用户报告的issue:
npm install -g lean-spec(v0.2.28) 后lean-spec ui或lean-spec mcp出现 "program not found" 错误npm install -g @leanspec/ui+npx @leanspec/ui可以正常工作环境信息
根本原因
缺失依赖: lean-spec主包没有声明dependencies
npm v10兼容性: npx命令已废弃,需使用
npm exec跨平台问题: Windows上使用'node'字符串而非process.execPath
修复内容
✓ packages/cli/package.json - 添加@leanspec/ui、@leanspec/http-server、@leanspec/mcp
✓ packages/ui/bin/leanspec-ui.js - 使用process.execPath、参数验证、错误消息改进
✓ rust/leanspec-cli/src/commands/ui.rs - npm exec替代npx、单元测试
✓ rust/leanspec-cli/src/commands/mcp.rs - npm exec替代npx、单元测试
验证方法