Fix: Remove all Deno dependencies and fix npx/global execution
Author: ruvnetCreated Jul 7, 2025Updated Sep 17, 2026
Labelsalready-fixed
Problem
The claude-flow init command was failing when run with npx claude-flow init or global claude-flow init commands because:
- Deno APIs throughout codebase - The init system was using
Deno.writeTextFile,Deno.mkdir, etc. which don't exist in Node.js - Working directory issues - Commands were executing in wrong directory due to spawn() configuration
- Command routing problems - TypeScript CLI was being used instead of working JavaScript CLI
Solution
✅ Completely removed all Deno dependencies and replaced with Node.js equivalents:
File System Operations Fixed:
Deno.writeTextFile()→fs.writeFile()Deno.mkdir()→fs.mkdir()Deno.stat()→fs.stat()Deno.Command()→execSync()Deno.env.get()→process.envDeno.cwd()→process.cwd()
Command Routing Fixed:
- Added init, hooks, mcp commands to simple-cli.js routing in cli.mjs
- Fixed working directory by using
process.cwd()instead of__dirname - Properly imported
fs/promisesandchild_process
Template System Fixed:
- Silenced non-fatal template loading errors
- All commands now use fallback content when templates missing
Testing Results
✅ All invocation methods now work correctly:
# Local wrapper - WORKS
./claude-flow init --force
# NPX command - WORKS
npx claude-flow init --force
# Global command - WORKS
claude-flow init --force
✅ Files properly created:
CLAUDE.md(8455 bytes).claude/settings.json(Claude Code hooks).claude/commands/(All documentation).claude/helpers/(Setup scripts)- Memory and coordination directories
Impact
- No more Deno dependencies - Pure Node.js/npm workflow
- Consistent behavior across all command invocation methods
- Proper Claude Code integration with working hooks
- Production ready for npm publishing
Fixes the core issue where users couldn't run npx claude-flow init successfully.
Source: ruvnet/ruflo