npm ERR! could not determine executable to run

以下のコマンドでsvelteのプロジェクトを作成しTailwindCSSの環境構築を行おうとすると

npm create vite@latest svelte-demo -- --template svelte-ts
cd svelte-demo
npm install
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

最後の行でエラーが、、、

npm ERR! could not determine executable to run

いろいろ調べるとTailwindCSSは3系と4系でインストール方法が異なるっぽい、、、

package.jsonを確認

    "tailwindcss": "^4.1.5",

どうやら4系らしいですね、、
ドキュメントを確認

https://tailwindcss.com/docs/installation/using-vite

以下を実行

npm install tailwindcss @tailwindcss/vite

URLの手順通り進めていけばひとまず問題なさそう、、

Follow me!

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

PAGE TOP