npx tailwindcss init报错npm error could not determine executable to run

PS D:\front-project\vue-cli-demo> npx tailwindcss init
npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\75364\AppData\Local\npm-cache_logs\2025-02-06T01_07_09_313Z-debug-0.log

遇到这个错,开始找日志

日志文件中没有具体信息,verbose stack Error: could not determine executable to run

定位js报错地址

在这里插入图片描述

这个方法是获取可执行的文件信息,我们打印一下入参

npx tailwindcss init报错npm error could not determine executable to run_第1张图片

确实没有可执行文件的信息

npx tailwindcss init报错npm error could not determine executable to run_第2张图片

官网给的命令是需要课执行文件的

npx tailwindcss init报错npm error could not determine executable to run_第3张图片

我们仔细看下,版本其实对应不上,安装的版本是4.0.3。但是官网的版本是3.4.17.

那么我们切换下版本即可

npm install -D [email protected]

你可能感兴趣的:(npm,前端,node.js)