Windows frontend build troubleshooting
Use this page when a Windows development checkout is up to date but the local UI
still looks old, or when npm install and frontend builds fail on a corporate
network.
Assumptions:
- Windows PowerShell is used for commands.
- Node.js is version
20.19or newer. - The checkout root is represented as
<repo-root>. - Your corporate root certificate is installed in Windows.
UI stays old after pulling new code
Section titled “UI stays old after pulling new code”Symptoms:
git pullorgit fetchbrings in frontend changes.- Browser still shows the old Jarvis UI at the local address.
- New buttons, screens, or text that exist in source code do not appear.
Root cause:
The local startup scripts only build the frontend bundle when the built
frontend/dist/index.html file is missing. If an old dist directory already
exists, the backend keeps serving that old static bundle.
Fix:
Rebuild the frontend after pulling frontend changes:
Set-Location <repo-root>\frontendnpm run buildThen hard refresh the browser with Ctrl+Shift+R. If the app is still stale,
open DevTools, unregister the service worker, and refresh again.
You usually do not need to restart the backend for this specific case because
the static files are read from disk after the new dist is written.
npm fails with SELF_SIGNED_CERT_IN_CHAIN
Section titled “npm fails with SELF_SIGNED_CERT_IN_CHAIN”Symptom:
SELF_SIGNED_CERT_IN_CHAINRoot cause:
A corporate TLS-inspecting proxy re-signs registry traffic with a company root certificate. Node and npm may not trust that root certificate unless you provide an extra certificate bundle.
Fix:
Point NODE_EXTRA_CA_CERTS at a PEM bundle that contains the company root
certificate:
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"npm pingnpm ping should return PONG. The environment variable applies to the
current shell. Add it to your user environment variables if you want it to
persist across new PowerShell sessions.
Prefer npm install over npm ci on managed networks
Section titled “Prefer npm install over npm ci on managed networks”Symptoms:
npm cifails after registry or audit requests.- npm prints
Exit handler never called!. - Later builds fail because tools such as
viteorvue-tscare not found.
Root cause:
npm ci removes node_modules before reinstalling from the lockfile. If npm
then fails while talking to the registry or audit service, the checkout can be
left with a partially installed dependency tree. The .bin shims may be empty
or packages may be missing their package.json files.
Fix:
Use npm install with certificate trust configured and audit disabled:
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"Set-Location <repo-root>\frontendnpm install --no-audit --no-fundThis repairs missing packages without first deleting the whole dependency tree.
Check whether node_modules is damaged
Section titled “Check whether node_modules is damaged”Inspect the command shims:
Get-ChildItem <repo-root>\frontend\node_modules\.binIf the directory is empty or nearly empty, reinstall dependencies:
Set-Location <repo-root>\frontendnpm install --no-audit --no-fundYou can also inspect a package directory that the build complains about. If the
package directory exists but has no package.json, the dependency tree is
incomplete and should be repaired with npm install.
Emergency build without .bin shims
Section titled “Emergency build without .bin shims”If .bin shims are missing but the Vite package itself is installed, you can
build the static frontend by calling Vite’s JavaScript entry directly:
Set-Location <repo-root>\frontendnode node_modules\vite\bin\vite.js buildUse this only as a temporary recovery step. It builds the static bundle but does not replace normal type checking and dependency repair.
Recommended pull and rebuild flow
Section titled “Recommended pull and rebuild flow”git fetch origingit pull --ff-only origin main
$env:NODE_EXTRA_CA_CERTS = "<repo-root>\.personal\ca-bundle.pem"
Set-Location <repo-root>\frontendnpm install --no-audit --no-fundnpm run buildAfter the build, hard refresh the browser. If a service worker keeps serving an old bundle, unregister it in DevTools and refresh again.
Quick reference
Section titled “Quick reference”| Symptom | Likely cause | First action |
|---|---|---|
| UI is stale after pulling code | Existing frontend/dist was served without rebuilding |
Run npm run build, then hard refresh. |
SELF_SIGNED_CERT_IN_CHAIN |
npm does not trust the corporate root CA | Set NODE_EXTRA_CA_CERTS to a PEM bundle and retry. |
Exit handler never called! |
npm failed during registry or audit work | Use npm install --no-audit --no-fund after fixing certificate trust. |
vite or vue-tsc is not recognized |
.bin shims are missing after a partial install |
Run npm install --no-audit --no-fund. |
| Build cannot resolve a package that exists as an empty directory | node_modules is partially installed |
Repair dependencies with npm install. |