1.1 KiB
1.1 KiB
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
- Run the .msi file
- It will replace Node.js v18 with v14
- Or use nvm-windows to have both versions
Step 3: Verify
node --version
Should show: v14.21.3
Step 4: Restart IIS
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:
- Install nvm-windows: https://github.com/coreybutler/nvm-windows/releases
- Install Node.js v14:
nvm install 14.21.3 - Use v14:
nvm use 14.21.3 - Then restart IIS