💨
npx tailwindcss initでnpm error could not determine executable to run
はじめに
TailwindCSSをReactに導入する際にnpx tailwindcss init
でエラーが出たので解決法を書いておきます。
エラー内容
npx tailwindcss init -p
npm error could not determine executable to run
npm error A complete log of this run can be found in:
解決方法
TailwindCSSのバージョンが4系になってインストール方法が大幅に変わったようです。
今まで通りのやり方でやるのであれば、下記のように3系をインストールしましょう。
npm install -D tailwindcss@3.4.13 autoprefixer postcss
npx tailwindcss init -p
Discussion