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报错地址
![](https://i-blog.csdnimg.cn/direct/61ed3dc42c024b77aba66adc01c50426.jpeg)
这个方法是获取可执行的文件信息,我们打印一下入参
![](https://i-blog.csdnimg.cn/direct/ec7b8903ad1f4d69909e64e413fa7e07.png)
确实没有可执行文件的信息
![](https://i-blog.csdnimg.cn/direct/7162c90f42f14f908ee964af1043afee.png)
官网给的命令是需要课执行文件的
![](https://i-blog.csdnimg.cn/direct/77317b95061942a69490ca4ab7688847.png)
我们仔细看下,版本其实对应不上,安装的版本是4.0.3。但是官网的版本是3.4.17.
那么我们切换下版本即可
shell
npm install -D tailwindcss@3.4.17