SPARC commands fail to detect Node.js when installed via NVM, despite Node.js being properly accessible
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 85
Description
## Labels
`bug`, `environment`, `path-resolution`, `nvm`, `sparc`
### Problem Summary
The `"npx" claude-flow sparc` commands fail to detect Node.js installation when Node.js is installed via Node Version Manager (NVM), even though Node.js is properly installed and accessible via standard terminal commands.
### Error Output
```bash
npx claude-flow sparc info spec-pseudocode
Error: Node.js is not installed or not in PATH
Please install Node.js from https://nodejs.org/
npx claude-flow sparc info architect
Error: Node.js is not installed or not in PATH
Please install Node.js from https://nodejs.org/
```
### Expected Behavior
The `npx claude-flow sparc` commands should detect and work with Node.js installations managed by NVM, just as they would with standard Node.js installations.
### Actual Behavior
The commands fail with a "Node.js is not installed or not in PATH" error despite Node.js being available and functional.
## Environment Details
### System Information
- **Operating System**: Windows 11
- **Node.js Installation Method**: Node Version Manager (NVM)
- **Shell Environment**: Git Bash / MSYS2
- **Claude Code Version**: Latest
- **claude-flow Package**: @alpha.88
### Node.js Environment Verification
```bash
# These commands work correctly in the same terminal:
node --version # Returns version number
npm --version # Returns version number
which node # Shows NVM path: ~/.nvm/versions/node/vX.X.X/bin/node
which npm # Shows NVM path: ~/.nvm/versions/node/vX.X.X/bin/npm
npx --version # Works for other packages
```
### NVM Configuration
- NVM properly configured in shell profile
- Node.js and npm accessible via PATH
- Environment variables correctly set
- Other npx commands work without issues
## Root Cause Analysis
The issue appears to be related to how `claude-flow sparc` commands detect the Node.js installation. Possible causes:
1. **PATH Resolution**: The tool may be using a different PATH resolution method than standard shell commands
2. **Environment Isolation**: The claude-flow process might be running in an isolated environment that doesn't inherit NVM's PATH modifications
3. **Node Detection Logic**: The tool's Node.js detection logic may be looking for Node.js in standard installation directories rather than using PATH resolution
4. **Shell Context**: The tool might not be inheriting the proper shell environment where NVM has modified the PATH
## Affected Features
- All `npx claude-flow sparc` commands fail
- SPARC methodology integration non-functional
- Development workflow disruption
- Unable to access claude-flow's advanced SPARC features
## Reproduction Steps
1. Install Node.js via NVM (any version)
2. Verify Node.js is working: `node --version`
3. Verify npx is working: `npx --version`
4. Try to run any claude-flow sparc command: `npx claude-flow sparc modes`
5. Observe the "Node.js is not installed or not in PATH" error
## Additional Context
### Related Issues
- I am using claude-flow command without calling it via npx, because that never worked
- This affects Windows users more frequently due to NVM for Windows implementation
- Similar issues may exist with other Node.js version managers (volta, n, etc.)
- The problem is specific to claude-flow's Node.js detection, not general npx functionality
Contributor guide
Research direction
Start by reproducing the failure with `npx claude-flow sparc modes` in Git Bash/MSYS2 while `node --version`, `npm --version`, and `which node` succeed. Trace the SPARC command's Node.js detection and compare its environment with the working terminal commands; done means NVM-managed Node.js is detected and the listed SPARC commands run successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, shell, typescript
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100