Home › npm & Node.js

npm ERR! could not determine executable to run — how to fix

npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2025-02-01T10_00_00_000Z-debug-0.log

Quick fix: Tailwind v4: the CLI is now @tailwindcss/cli (npx @tailwindcss/cli -i input.css -o output.css) and init is gone. For a v3 setup run npm install -D tailwindcss@3 then npx tailwindcss init -p. In general, check the package's bin names with npm view <pkg> bin and use npx -p <pkg> <bin>.

What it means

npx <name> first looks for an executable called <name> in node_modules/.bin. If it doesn't find one, it installs the package <name> temporarily and runs the command that package declares in the bin field of its package.json. The error means the package was found, but it has no bin entry npx could pick.

Check what a package actually provides:

npm view tailwindcss bin          # prints nothing if there is no bin
npm view @tailwindcss/cli bin

Cause 1: Tailwind CSS v4 (npx tailwindcss init)

Tailwind v4 split the CLI out of the tailwindcss package. npm install tailwindcss now gives you v4, which has no tailwindcss executable, and the init command (which created tailwind.config.js) no longer exists because v4 is configured in CSS.

Fix A: use v4 the v4 way. Pick the integration for your build tool. For the standalone CLI:

npm install -D tailwindcss @tailwindcss/cli
npx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch
/* src/input.css */
@import "tailwindcss";

With Vite, use the @tailwindcss/vite plugin. With PostCSS, use @tailwindcss/postcss. See the Tailwind docs for your framework.

Fix B: follow a v3 tutorial as written. Install v3 explicitly:

npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p

Cause 2: the command name differs from the package name

Some packages provide a command with a different name, or several commands. Tell npx which package to install and which command to run:

npx -p @angular/cli ng new my-app
npx --package=typescript -- tsc --version

Cause 3: the package isn't installed where you think

If you expect a local dev dependency to be used, make sure you're in the project folder and dependencies are installed:

cd my-project
ls node_modules/.bin | grep <name>
npm install            # restore node_modules if it's missing

If node_modules looks broken (interrupted install, lock file conflicts), reinstall it cleanly:

rm -rf node_modules package-lock.json
npm install

Cause 4: the tool changed its CLI

Older instructions sometimes run a subcommand that was removed. For example, npx husky install was the setup step for husky v8, but newer husky versions use npx husky init (and husky in the prepare script). If a command from a tutorial fails, check which major version the tutorial used and either pin that version (npm install -D pkg@8) or follow the current docs.

Debug it

npx --version     # npx ships with npm 7+, check npm is current
npm view <pkg> version bin

The debug log path printed under the error shows which package npx resolved and what it tried to run.

Last updated 2026-12-04.