Problem: This is a known npm bug with optional dependencies on Windows (see npm issue #4828)
Solution 1: Use Yarn (Recommended)
# Install yarn globally
npm install -g yarn
# Install dependencies with yarn
yarn install
# Run dev server
yarn devSolution 2: Clean npm Install
# Remove node_modules and lock files
rm -r node_modules
rm package-lock.json
# Reinstall
npm install
# Run dev server
npm run devSolution 3: Use npm ci
# Clean install using lock file
npm ci
# Run dev server
npm run devSolution 4: Build instead of dev If you only need to test the build:
npm run build
npm run previewCause: Node.js or npm not properly installed
Solution:
# Check versions
node --version # Should be v18 or higher
npm --version # Should be v9 or higher
# Update npm
npm install -g npm@latestCause: Port 5173 is already in use by another process
Solution 1: Kill the process
# On Windows (PowerShell as admin)
Get-Process | Where-Object {$_.Port -eq 5173} | Stop-Process -Force
# On Mac/Linux
lsof -i :5173
kill -9 <PID>Solution 2: Use different port
npm run dev -- --port 3000Cause: Missing or misnamed component import
Solution:
- Check component name spelling in
components/folder - Verify the import path is correct
- Clear browser cache (Ctrl+Shift+Delete)
Cause: Type definitions missing
Solution:
# Reinstall dependencies
rm -r node_modules
npm install # or yarn installCause: Type mismatches in code
Solution:
- Check error messages carefully
- Review the TypeScript at that line
- Ensure all types are properly imported
- Check the TypeScript type definitions in
types.ts
Cause: Large bundle or slow system
Solution:
- Try again - first build is slowest
- Check disk space
- Close other applications
- Try
npm run buildinstead ofnpm run dev
Cause: Running in Node.js instead of browser
Solution: Only use in browser context, not during server build
Cause: Missing dependencies in useMemo/useCallback
Solution: Check dependency arrays in hooks:
useMemo(() => {
// calculation
}, [dep1, dep2]) // Include all used variablesRequirement: Modern browser with ES6 support
Supported:
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
Solution: Update your browser
Cause: Private browsing or localStorage disabled
Solution:
- Disable private browsing
- Check browser storage settings
- Clear browser data if corrupted
Cause: Large JavaScript bundle or slow network
Solution:
- Build for production:
npm run build - Use preview mode:
npm run preview - Check network tab in DevTools
- Disable browser extensions
Cause: Missing memoization
Solution: All calculations use useMemo - this is normal for first render
Solution:
# Check git is installed
git --version
# Clone with HTTPS (if SSH doesn't work)
git clone https://github.com/Stackbilt-dev/equity-scenario-sim.git
# Or with SSH
git clone git@github.com:Stackbilt-dev/equity-scenario-sim.gitSolution:
# Check status
git status
# Stage changes
git add .
# Commit
git commit -m "Your message"
# Push
git push origin mainRecommendation: Use whichever works for your system
# npm
npm install
npm run dev
# yarn
yarn install
yarn dev
# pnpm
pnpm install
pnpm run devWindows: Download from nodejs.org
- Get the LTS version
- Run installer
- Restart your terminal
Mac:
brew install nodeLinux (Ubuntu/Debian):
sudo apt update
sudo apt install nodejs npm- README.md - Basic setup
- CONTRIBUTING.md - Development guidelines
- This file - Troubleshooting
- GitHub Issues - Report bugs or ask questions
- Provide error message exactly as shown
- Include Node.js and npm versions
- Describe what you were trying to do
- GitHub Discussions - General questions
- GitHub Issues - Specific problems
- CODE_OF_CONDUCT.md - Community guidelines
# Fresh setup
git clone https://github.com/Stackbilt-dev/equity-scenario-sim.git
cd equity-scenario-sim
npm install # or yarn install
npm run dev # or yarn dev
# Then open: http://localhost:5173- Repository: https://github.com/Stackbilt-dev/equity-scenario-sim
- npm Registry: https://www.npmjs.com/package/equity-scenario-sim
- Node.js: https://nodejs.org
- Vite Docs: https://vitejs.dev
- React Docs: https://react.dev
# Verbose npm output
npm install --verbose
# Debug vite
npm run dev -- --debug# npm cache
npm cache clean --force
# Clear all node modules
rm -r node_modules package-lock.json
# Reinstall
npm installHelpful when reporting issues:
# Check Node version
node --version
# Check npm version
npm --version
# Check git version
git --version
# Check OS
uname -a # Mac/Linux
ver # WindowsStill stuck? Open an issue on GitHub Issues