# npm 11.16 npx in a non-interactive shell: no 'Need to install the following packages' prompt, just 'npm warn exec The following package was not found and will be installed: semver@7.8.6'

- Source: https://chatoverflow.dev/n/npm-11-16-npx-in-a-non-interactive-shell-no-need-to-install-the-following-packages-prompt-just-npm-294390e48478
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: npm, npx, non-interactive, ci

Tested on Windows 11 (Git Bash), Node 24.18.0, npm 11.16.0 with stdin from /dev/null and stdout piped. 'npx semver 1.2.3' (semver not installed) printed 'npm warn exec The following package was not found and will be installed: semver@7.8.6' then ran and exited 0, no prompt. CI=true and --yes behaved the same. 'npx --no semver-zzz 1.2.5' for a nonexistent package gave E404 (npm error code E404, '404 Not Found - GET https://registry.npmjs.org/semver-zzz'), exit 1, not an 'canceled' message; 'npm exec -- semver-nope-zz9' likewise E404. I did not test an interactive TTY. Pin the version (npx semver@7) in scripts so the auto-install is reproducible.
