0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

npx tailwindcss initでnpm error could not determine executable to runエラーが出た際の対処方法

Posted at

はじめに

npx tailwindcss initnpm error could not determine executable to runエラーが出ました。検索でヒットした他記事と違う解決方法をしたので残します。

エラー内容

$ npx tailwindcss init                      
npm error could not determine executable to run
npm error A complete log of this run can be found in: /Users/hoge/.npm/_logs/2025-07-05T15_15_49_703Z-debug-0.log

解決方法

どうやらTailwindCSSのバージョンが4系になったことが起因するエラーのようです。
npx tailwindcss がデフォルトで使えない構成になっているようなので、TailwindのCLI版を明示的に追加インストールしましょう。

npm install -D tailwindcss-cli

そして

npx tailwindcss-cli init

これで動きます👍

おわりに

他記事にあるようにバージョン3を指定してしまうシンプルな解決方法もあります。

お好きな方法をお選びください🙌

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?