PozoAppCommonUpdatedCode/FINAL-SOLUTION.md

47 lines
1.1 KiB
Markdown
Raw Normal View History

2025-12-05 09:45:16 +05:30
# Final Solution - IIS Only
## Problem
iisnode 0.2.21 (from 2014) doesn't support Node.js 18.20.4 (from 2024)
## Solution: Install Node.js v14
### Step 1: Download Node.js v14
- URL: https://nodejs.org/download/release/v14.21.3/node-v14.21.3-x64.msi
- Version: v14.21.3 (LTS)
- This version is compatible with iisnode 0.2.21
### Step 2: Install
1. Run the .msi file
2. It will replace Node.js v18 with v14
3. Or use nvm-windows to have both versions
### Step 3: Verify
```cmd
node --version
```
Should show: v14.21.3
### Step 4: Restart IIS
```cmd
iisreset
```
### Step 5: Test
Browser: `http://localhost:8080`
## Why This Works
- iisnode 0.2.21 was designed for Node.js v0.10 - v14
- Node.js v18 uses different APIs that iisnode 0.2.21 doesn't understand
- Node.js v14 will work perfectly with iisnode 0.2.21
## After It Works
Once `app.cjs` works, we can switch to `server.cjs` with your full Express app.
## Alternative: Use nvm-windows
If you need both Node.js versions:
1. Install nvm-windows: https://github.com/coreybutler/nvm-windows/releases
2. Install Node.js v14: `nvm install 14.21.3`
3. Use v14: `nvm use 14.21.3`
4. Then restart IIS