Follow the process that receives the request, then follow the process it starts.

The Windows service is the starting point

I checked the running service instead of inferring its identity from my terminal. The Service Control Manager reports a service named <code>lighttpd</code>, configured to start automatically as <code>LocalSystem</code>, with <code>C:\tools\lighttpd\lightsvc.exe</code> as its service image. The live process list shows both <code>lightsvc.exe</code> and <code>lighttpd.exe</code>, started together from the Lighttpd installation folder. The server identifies itself as Lighttpd 1.4.49, a Windows package built with Cygwin.

Those are facts about this machine's configuration, not a universal recipe for running Lighttpd on Windows. Here the service starts at boot and remains alive while browser requests arrive. It is not a command launched by my interactive PowerShell or Command Prompt. It therefore has its own startup environment and current directory. Changing a variable in my login shell cannot rewrite the environment block already held by the running server.

Running under <code>LocalSystem</code> also explains why CGI temporary paths in diagnostics point into the system profile. The authoring wrapper deliberately defines its own <code>TEMP</code> and <code>TMP</code>, so its child tools use the shared Lighttpd temporary folder instead. The service identity and the wrapper's later environment settings are separate parts of the same launch chain.

Lighttpd supplies a base environment to CGI

The service loads <code>conf/service.conf</code>, which configures the access and error logs and includes <code>lighttpd.conf</code>. The main configuration loads <code>mod_cgi</code> and <code>mod_setenv</code>. Its shared variables file derives the server root from the current directory and sets the temporary directory beneath it. It adds a base PATH containing Windows system folders to external applications.

Lighttpd's <a href="https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_cgi">CGI documentation</a> describes the server's role in launching scripts and providing CGI request variables. Its <a href="https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_setenv">mod_setenv documentation</a> describes how configuration can add environment values for external applications. Those settings explain the baseline, but they are not the final environment seen by every script: the selected executable can be another wrapper that changes it again.

In this configuration, a normal URL ending in <code>.cgi.js</code> is assigned to <code>C:\tools\lighttpd\cgi-js.cmd</code>. The authoring and moderation URLs have more specific mappings to dedicated wrappers. The browser requests the same CGI URL as always, while Lighttpd chooses the executable according to the configured route. That mapping is part of the application's runtime behavior and belongs in the deployment investigation.

The authoring wrapper narrows and completes the environment

The authoring URL maps to <code>C:\ProgramData\WshBlogAuthoringPreview\cgi-authoring.cmd</code>. This wrapper uses <code>setlocal</code>, defines the Windows system folders it needs, points <code>TEMP</code> and <code>TMP</code> at <code>C:\tools\lighttpd\tmp</code>, and replaces PATH with a short list ending in <code>C:\TOOLS\scripts</code>. That deliberate PATH is why putting an executable somewhere in my interactive PATH is not enough to make it available to this CGI route.

The wrapper then allocates a request-specific temporary directory, converts the incoming UTF-8 body to UTF-16 for Windows Script Host, runs the deployed <code>Authoring.js</code> through <code>cscript.exe</code>, and converts its output back to UTF-8 for Lighttpd. It logs the CGI identifier, exit status, output size, and any captured error text before cleaning temporary files. This is an explicit bridge between an HTTP CGI process and a Unicode WSH program.

These layers also answer why “there is only one local user” does not remove the problem. The service is a separate process with a specific service identity. Lighttpd supplies a configured baseline. The authoring wrapper replaces selected values. WSH starts a child process that inherits the wrapper's process environment, with narrowly scoped overrides for individual tools. There is no shared login shell in that chain.

Fix the layer that owns the missing value

I use this trace to choose a precise fix. If Lighttpd cannot find the CGI handler, the route mapping or service PATH is wrong. If the wrapper cannot find a tool, its explicit PATH or tool resolver configuration needs attention. If a child process needs an extra variable, the process call can provide it for that synchronous launch. Restarting the whole service to repair one compiler invocation would affect a much broader lifetime than necessary.

The deployed build now asks the LiveScript compiler adapter to pass <code>NODE_SKIP_PLATFORM_CHECK=1</code> only to its Node-based command. Mermaid passes the same compatibility value at its own Node tool boundary. The CGI wrapper no longer defines the variable, and unrelated CGI programs do not inherit the exception. The local preview build returned its normal redirect response after that per-tool change, and the generated preview contained the new article.

This variable bypasses Node's startup version check on the older Windows host. It does not make that operating system supported or promise that every Node package will work. The important operational fact is that the setting is visible at the exact tool call that needs it and does not silently become a service-wide policy.