mcporter generate-cli fails: esbuild Could not resolve commander/mcporter
Running
npx mcporter generate-cli --command https://mcp.context7.com/mcp --compileon Arch Linux (Bun 1.3.1) fails with esbuild errorsCould not resolve "commander"andCould not resolve "mcporter"in the generated context7.ts. Is there a workaround, and has this been fixed?Originally asked on GitHub: https://github.com/openclaw/mcporter/issues/1
3 answers
Fixed in mcporter 0.3.1 — a collaborator reproduced the failure and confirmed the fix in that release. The thread does not state the exact root cause of the esbuild resolution errors.
The workaround reported in the thread is to install mcporter into a local directory and run the local binary instead of going through
npx:bashmkdir mcporter-test && cd mcporter-test npm i mcporter ./node_modules/.bin/mcporter generate-cli --command https://mcp.context7.com/mcp --compile context7Note the extra
context7argument after--compilein that invocation. The commenter reported that the generated binary is fully portable, so you can move it somewhere on your PATH, then delete the mcporter-test directory.The original failing command was
npx mcporter generate-cli --command https://mcp.context7.com/mcp --compile; whether that exactnpxinvocation works on 0.3.1 is not stated in the thread, so the local-install workaround remains the documented path if you hit this.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Ran
npx mcporter generate-cli --command https://mcp.context7.com/mcp --compileon Arch Linux x86_64 with Bun 1.3.1. esbuild failed withCould not resolve "commander"andCould not resolve "mcporter"in tmp/mcporter-cli-t8pBTY/context7.ts.Source: https://github.com/openclaw/mcporter/issues/1 (opens external site)
Did this work for you?What @NickChristensen tried on GitHub (Worked)
A commenter reported this workaround: create a temporary directory, run
npm i mcporter, then invoke./node_modules/.bin/mcporter generate-cli --command https://mcp.context7.com/mcp --compile context7. The generated binary is fully portable and can be moved into PATH, after which the temporary directory can be deleted.Source: https://github.com/openclaw/mcporter/issues/1#issuecomment-3497453653 (opens external site)
Did this work for you?
Related questions
- mcporter auth linear returns 401 SSE error; workaround using mcp-remote
- How to fix mcporter Notion MCP auth error 'SSE error: Non-200 status code (401)'?
- mcporter invalid_scope: hardcoded mcp:tools OAuth scope breaks OIDC MCP servers
- mcporter auth on headless server: OAuth URL never printed, CLI just waits
- mcporter OAuth auth fails with 401 before browser opens (Notion/Linear MCP)