
Windows NPM run script shell
Troubleshoots Windows npm run scripts that fail before the script starts
Windows NPM run script shell is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 18
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Windows NPM run script shell
This skill helps an agent diagnose why npm run, npm test or npm run build exits on Windows before the underlying tool runs. It covers errors such as ERR_INVALID_ARG_TYPE, a missing ComSpec variable, a broken script shell, and npm cache or log writes blocked with EPERM in sandboxed workspaces.
The workflow starts by running the target tool directly with npx to confirm the project itself builds. It then reruns the npm script with verbose logging, inspects the npm debug log, and reads npm shell and cache configuration along with ComSpec and SHELL values from PowerShell.
The suggested fixes favor a project-local .npmrc that sets script-shell and a local cache directory, so the change travels with the repository. The skill also warns against rewriting application code when only the npm wrapper fails, and it lists a completion check that the original npm script and the direct tool command both pass.
When your agent uses it
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.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (3 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/windows-npm-run-script-shell to use it in all your projects:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/windows-npm-run-script-shell &&
cp -R "$tmp/shared_skills/active/windows-npm-run-script-shell" ~/.claude/skills/windows-npm-run-script-shell &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/windows-npm-run-script-shell inside it instead.
Copy the skill folder to ~/.agents/skills/windows-npm-run-script-shell to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/windows-npm-run-script-shell &&
cp -R "$tmp/shared_skills/active/windows-npm-run-script-shell" ~/.agents/skills/windows-npm-run-script-shell &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/windows-npm-run-script-shell inside it instead.
Copy the skill folder to ~/.cursor/skills/windows-npm-run-script-shell to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/windows-npm-run-script-shell &&
cp -R "$tmp/shared_skills/active/windows-npm-run-script-shell" ~/.cursor/skills/windows-npm-run-script-shell &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/windows-npm-run-script-shell inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/JinNing6/Noosphere.git --path shared_skills/active/windows-npm-run-script-shellOr copy the folder to ~/.gemini/skills/windows-npm-run-script-shell yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/windows-npm-run-script-shell:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/windows-npm-run-script-shell &&
cp -R "$tmp/shared_skills/active/windows-npm-run-script-shell" ~/.copilot/skills/windows-npm-run-script-shell &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/windows-npm-run-script-shell inside it instead.
Get the folder:
git clone --depth 1 https://github.com/JinNing6/Noosphere.gitThen copy Noosphere/shared_skills/active/windows-npm-run-script-shell into your agent's skills folder as windows-npm-run-script-shell. Agents that support SKILL.md read one folder per skill.
What it does
- Shell failure triage
- Steps to tell an npm shell configuration problem apart from a real project build failure.
- Direct tool comparison
- Runs the target tool with npx to confirm whether the failure comes from npm or the project.
- Project-local npm config
- Suggests .npmrc settings for script-shell, cache location and notices that stay inside the repo.
- Sandbox EPERM handling
- Explains how to handle npm cache and log write failures in restricted Windows workspaces.
- PowerShell script caveats
- Notes that Windows PowerShell 5 does not support && in package scripts.
Good for
- Fix npm test exiting with ERR_INVALID_ARG_TYPE on Windows
- Make npm run build work when npx tsc passes directly
- Stop npm cache EPERM errors in a sandboxed Windows project
- Set a project-local script-shell for npm scripts on Windows
- Find out why npm run prints no output on Windows
Windows NPM run script shell FAQ
When does Windows NPM run script shell trigger?
It applies when Windows npm run, npm test, npm run build or npm run-script exits before running the script, with errors such as ERR_INVALID_ARG_TYPE, missing ComSpec, broken script-shell, or EPERM in the npm cache or log directory.
Does Windows NPM run script shell change global npm settings?
Its guidance is to prefer a project-local .npmrc and to avoid global npm config changes unless the user asks for machine-wide changes.
Does Windows NPM run script shell include scripts or extra files?
No. The folder contains only the SKILL.md file, with no bundled scripts.
Does Windows NPM run script shell require a specific AI client?
The skill is a plain SKILL.md folder with no client-specific hooks or plugin packaging, so it follows the shared agent skills format.
How do I install Windows NPM run script shell in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/windows-npm-run-script-shell to use it in all your projects, or to .claude/skills/windows-npm-run-script-shell in one project.
Does Windows NPM run script shell run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Windows NPM run script shell?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Windows NPM run script shell?
The closest alternatives to Windows NPM run script shell are Use pnpm, Sandbox NPM install, Debugging and error recovery, Windows child process lifecycle and CLI install.
Where this comes from
- Description: from the skill's own SKILL.md.
More from JinNing6/Noosphere

Checks a shared Noosphere skill registry before debugging a concrete software failure
- Open source
- 18 GitHub stars
- Developer tools

Has the agent check Noosphere shared debugging memory before fixing bugs and upload
- Open source
- 18 GitHub stars
- Knowledge and memory

Lets an agent audit credential loaders so raw key bytes are never altered before
- Open source
- 18 GitHub stars
- Security

Diagnoses browser clicks, hover and focus that fail though elements look visible
- Open source
- 18 GitHub stars
- Browser automation

Diagnoses why a Cloudflare Pages site still serves old assets after a deploy
- Open source
- 18 GitHub stars
- Cloud and infrastructure

Fixes Codex Desktop project sidebar ordering so recently active projects move to the top
- Open source
- 18 GitHub stars
- Developer tools




