You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

执行npx tailwindcss init -p时出现“npm error could not determine executable to run”错误的原因咨询

执行npx tailwindcss init -p时出现“npm error could not determine executable to run”错误的原因咨询

我已经用Tailwind CSS做项目很长时间了。最近启动新项目时,我按照往常的习惯先安装了包,然后通过命令 npx tailwindcss init -p 创建了 tailwind.config.js 文件,但却遇到了一个意外的错误——明明已经安装了Tailwind CSS,npm却找不到npx tailwindcss调用的可执行文件。

要重现这个错误,只需要在项目根目录运行以下两个命令:

$ npm install -D tailwindcss
$ npx tailwindcss init -p

  npm error could not determine executable to run
  npm error A complete log of this run can be found in:
  ...

(错误截图显示:npm提示“could not determine executable to run”,并给出了日志文件的路径)

为什么以前这么操作都没问题,现在却出现这个错误了呢?

备注:内容来源于stack exchange,提问作者DHEERAJ KUMAR

火山引擎 最新活动