AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Windows Npm Run Script Shell

skill-jinning6-noosphere-windows-npm-run-script-shell · by JinNing6

Use when Windows npm run, npm test, npm run build, or npm run-script exits before running the script with ERR_INVALID_ARG_TYPE, "file argument must be of type string", missing ComSpec, broken script-shell, stripped CLI flags, sandboxed npm cache/log EPERM, or silent npm script output.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-jinning6-noosphere-windows-npm-run-script-shell

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jinning6-noosphere-windows-npm-run-script-shell)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
26d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Windows Npm Run Script Shell? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Windows Npm Run Script Shell

Overview

Windows npm scripts need a shell. If ComSpec is missing or npm cannot infer a script shell, npm run ... can fail inside npm before tsc, Vite, Vitest, or Playwright actually runs.

Triage

Use this flow before changing app code:

  1. Run the target tool directly with npx, for example npx tsc -b --pretty false, npx vite build, or npx vitest run.
  2. Run npm run --loglevel verbose.
  3. Open the npm debug log if output is empty.
  4. Check shell config:
npm config get script-shell
npm config get cache
npm config get update-notifier
Write-Host "ComSpec=[$env:ComSpec]"
Write-Host "SHELL=[$env:SHELL]"

If direct npx commands pass but npm run fails with ERR_INVALID_ARG_TYPE: The "file" argument must be of type string. Received undefined, treat it as npm shell configuration, not a project build failure.

If direct node succeeds but npm test/npm run exits silently in a sandbox, rerun with --loglevel verbose. When npm reports EPERM creating %LocalAppData%\npm-cache\_logs or attempts registry access only for update checks, treat it as npm runtime side effects, not a test failure.

Fix

Prefer a project-local .npmrc so the fix travels with the repo:

script-shell=C:\Windows\System32\cmd.exe

For sandboxed Windows workspaces where npm cannot write the user cache/log directory, keep npm side effects inside the repo and disable network-prone notices:

cache=.npm-cache
update-notifier=false
fund=false
audit=false
script-shell=cmd.exe

Then rerun:

npm run build
npm test -- --run

If the project requires PowerShell syntax in scripts, set script-shell to PowerShell and avoid && in package scripts, because Windows PowerShell 5 does not support &&.

Common Mistakes

  • Do not rewrite TypeScript, Vite, Vitest, or React code when npx succeeds and only npm run fails.
  • Do not treat silent npm output as proof that the build tool produced no diagnostics; inspect the npm debug log.
  • Do not ignore npm cache/log EPERM in sandboxed workspaces; set a project-local cache before escalating.
  • Do not set a global npm config unless the user asked for machine-wide changes.
  • Do not assume SHELL replaces ComSpec for npm on Windows.

Completion Standard

The issue is fixed only when:

  • The original npm run command succeeds.
  • The direct tool command still succeeds.
  • Tests/builds that previously passed via npx also pass through npm scripts.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.