iisnode fails to start your Node.js app under IIS
IIS reporting error code 0x5 (ERROR_ACCESS_DENIED)Short answer
When iisnode cannot start your app, IIS shows an error page and the cause is in the details. The three confirmed causes are: the app pool identity cannot read and run node.exe, the iisnode build does not match the Windows bitness, or iisnode is not pointed at the right node.exe. Turn on iisnode logging first.
Fix it fast
1Find out which cause you have
Make iisnode capture what node.exe writes to stdout and stderr, and show detail in the error page. In web.config, check that loggingEnabled is true and note the logDirectory (a folder next to your main file, default name iisnode). Then read the newest file in it.
<!-- web.config --> <iisnode loggingEnabled="true" logDirectory="iisnode" devErrorsEnabled="true" />2Match what you see, then jump to its fix
- 1
IIS reporting error code 0x5 (ERROR_ACCESS_DENIED)The app pool identity cannot run node.exeFix - 2
The module installed fine but no request ever reaches node, or IIS Express and full IIS behave differentlyThe iisnode build does not match the Windows bitnessFix - 3
Nothing starts, and node.exe is installed in a folder other than the defaultiisnode is not told where node.exe livesFix
- 1
What does the error look like?
IIS reporting error code 0x5 (ERROR_ACCESS_DENIED)503 response from a site that works when you run node server.js by hand
Cause 1 of 3
The app pool identity cannot run node.exe
1Check
Error 0x5 is access denied. The default pool identity (ApplicationPoolIdentity) belongs to the IIS_IUSRS group, so check what that group may do to the node.exe folder.
icacls C:\node\node.exe2Fix
Give IIS_IUSRS read and execute rights on node.exe. The iisnode FAQ shows this form for a node.exe in a folder on the system drive.
icacls %systemdrive%\node\node.exe /grant IIS_IUSRS:rx3Verify
Recycle the application pool and request the site again.
iisresetConfirmed by github.com
Cause 2 of 3
The iisnode build does not match the Windows bitness
1Check
iisnode ships separate x86 and x64 MSI packages and the README says to match your system. IIS Express always uses the x86 build, as the FAQ notes.
systeminfo | findstr /C:"System Type"
dir "%programfiles%\iisnode"2Fix
Install the iisnode package whose bitness matches your Windows. For IIS Express on 64-bit Windows, install the full x64 version or the separate iisnode express version.
echo Reinstall iisnode using the MSI that matches the System Type printed above3Verify
Request the site again and read the newest log file.
dir iisnodeConfirmed by github.com
Cause 3 of 3
iisnode is not told where node.exe lives
1Check
The nodeProcessCommandLine setting is the command line iisnode uses to start the node executable. The sample web.config shows it as %programfiles%\nodejs\node.exe. Compare that with where node.exe really is.
where node2Fix
Set nodeProcessCommandLine to the full path of the node.exe you installed.
<iisnode nodeProcessCommandLine=""%programfiles%\nodejs\node.exe"" />3Verify
Recycle the pool and request the site again.
iisresetConfirmed by github.com
How do I stop it coming back?
- Keep node.exe in a fixed folder that IIS_IUSRS can read, and write that path down for each server.
- Leave loggingEnabled on during rollout and read the iisnode log folder after each deploy.
- Install the iisnode MSI that matches the server's bitness, and record the version.
- Turn devErrorsEnabled off once the site is live so detail is not sent to browsers.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
ng serve says it cannot determine the project or target
Cannot determine project for command.
The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.
3 causes, each with a fixBack end
ng fails with Cannot find module @angular/cli/bin/ng
Cannot find module '@angular/cli/bin/ng'
The ng command is the entry point to the Angular CLI package.
2 causes, each with a fixBack end
Angular app shows 'Cannot GET /' when served by a Node.js server
Cannot GET /dashboard
Cannot GET / is Express saying no route or file matches the request.
3 causes, each with a fixBack end
ng serve cannot find the dev-server builder package
Could not find the implementation for builder @angular/build:dev-server
The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root.
3 causes, each with a fixBack end
Angular build says it cannot resolve '@angular/localize/init'
Can't resolve '@angular/localize/init' in '/usr/src/app/src'
The build imports @angular/localize, and that package is not in node_modules.
2 causes, each with a fixBack end
The command npm run build -- --prod exited with code 1 (Angular)
The command "npm run build -- --prod" exited with code 1
Exit code 1 only says the build failed; the real message is above it.
2 causes, each with a fix