windows-npm-run-script-shell

windows-npm-run-script-shell is a skill for Claude Code, Codex from JinNing6/Noosphere. It costs 70 tokens per session (710 once invoked), scanned A, original, Apache-2.0.

Troubleshooting guidance for Windows npm scripts, such as npm test, npm run build, and npm run-script. It focuses on failures caused by missing or broken shell settings rather than by the project code.

In plain words
What is it for?
Use it when Windows npm commands fail before running their scripts, show ERR_INVALID_ARG_TYPE, lose command-line flags, produce no output, or report cache and log permission errors.
Why use it?
It helps distinguish an npm or Windows shell problem from a real TypeScript, Vite, Vitest, or Playwright failure. It provides checks for shell configuration, logs, cache permissions, and direct command execution.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jinning6/noosphere/windows-npm-run-script-shell
Any agent
npx skills add JinNing6/Noosphere --skill windows-npm-run-script-shell
Clone the repo
git clone --depth 1 https://github.com/JinNing6/Noosphere

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for windows-npm-run-script-shell

README.md
[![agentmods](https://agentmods.dev/badge/skills/jinning6/noosphere/windows-npm-run-script-shell.svg)](https://agentmods.dev/skills/jinning6/noosphere/windows-npm-run-script-shell)
Your own site
<a href="https://agentmods.dev/skills/jinning6/noosphere/windows-npm-run-script-shell"><img src="https://agentmods.dev/badge/skills/jinning6/noosphere/windows-npm-run-script-shell.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.00710
Opus 5 $0.00035 $0.00355
Sonnet 5 $0.00014 $0.00142
Haiku 4.5 $0.00007 $0.00071

Measured 5d ago against content hash 7af3dc0b48d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

windows-npm-run-script-shell scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

shared_skills/active/windows-npm-run-script-shell/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 <script> --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 <script> 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 <tool> 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.

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 75 lines · 70 tokens per session scan A 7af3dc0b48d2

Subscribe to this mod's changes

windows-npm-run-script-shell is a skill published in the GitHub repository JinNing6/Noosphere (18 stars, last pushed 4d ago), licensed Apache-2.0. It adds 70 tokens to every session and 710 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

prjct

The agentic harness for AI coding agents: machine-verified ships, guarded edits, and project lookup that beats re-deriving from source. Run the prjct verb yourself; use prjct work normally.

prjct-app/cli · 46 tokens

memstate-ai

Persistent, versioned memory for AI agents via Memstate AI. Alternative to the Memstate MCP plugin — use for storing facts, recalling memory, managing projects, and semantic search of agent summaries. Supports Markdown ingestion and direct keypath = value assignment. Requires MEMSTATEAPIKEY.

memstate-ai/memstate-mcp · 60 tokens

kaeru

Cognitive memory layer for LLM agents — typed graph + bi-temporal substrate + curator API, reached through the kaeru MCP server. Use when the user wants to capture, recall, reason, or trace persistent thoughts across sessions; when re-entering a multi-session project; or when the user explicitly asks to "remember"…

LamantinAI/kaeru · 91 tokens

writing

将共享历史中的已验证事实和计算结果整理成符合受众、格式与长度约束的成稿。.

bojieli/ai-agent-book · 27 tokens

kayba-stage-7-fixer

Implement the approved fixes from the action plan and log all changes. Trigger when the user says "run stage 7", "implement fixes", "apply action plan", or when invoked by the kayba-pipeline orchestrator. Requires eval/actionplan.md to exist.

kayba-ai/agentic-context-engine · 61 tokens

food-order

Reorder previous Foodora orders, preview cart contents, and track delivery ETA/status with ordercli. Use when the user wants to reorder food, check delivery status, or browse recent Foodora order history. Never confirm an order without explicit user approval.

Bitterbot-AI/bitterbot-desktop · 53 tokens