tailwind css - Can't install TailwindCSS 4 standalone - Stack Overflow

Trying to install Tailwind 4.0 full standalone CLI following their own documentation here:Standalone CL

Trying to install Tailwind 4.0 full standalone CLI following their own documentation here:

  • Standalone CLI: Use Tailwind CSS without Node.js - TailwindCSS Blog

I copy and paste the example for macOS arm64 as those apply to my hardware:

  • Download tailwindcss-macos-arm64 from v4.0.3 release - TailwindCSS Release - GitHub
chmod +x tailwindcss-macos-arm64
mv tailwindcss-macos-arm64 tailwindcss

So far so good. To get the config file I'm instructed to: ./tailwindcss init but I get:

Invalid command: init

What am I missing/doing wrong?

Trying to install Tailwind 4.0 full standalone CLI following their own documentation here:

  • Standalone CLI: Use Tailwind CSS without Node.js - TailwindCSS Blog

I copy and paste the example for macOS arm64 as those apply to my hardware:

  • Download tailwindcss-macos-arm64 from v4.0.3 release - TailwindCSS Release - GitHub
chmod +x tailwindcss-macos-arm64
mv tailwindcss-macos-arm64 tailwindcss

So far so good. To get the config file I'm instructed to: ./tailwindcss init but I get:

Invalid command: init

What am I missing/doing wrong?

Share Improve this question edited Feb 6 at 12:55 rozsazoltan 11.5k6 gold badges21 silver badges60 bronze badges asked Feb 3 at 0:37 MichaelMichael 1492 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The article you are referring to was written in 2021. TailwindCSS v4 only debuted this January 2025, so the article's content is outdated and was written for v3. Follow the new documentation; here are some important changes for you.

  • Get Started with Tailwind CLI TailwindCSS v4 Docs
  • Upgrade guide: Using Tailwind CLI - TailwindCSS v3 to v4
  • TailwindCSS v4 Alpha: Using the CLI - TailwindCSS v4-alpha release note

Deprecated init process

In v4, the installation process has changed. It's now simpler. The init command has become obsolete and is no longer usable from v4 onwards because it's not needed anymore.

  • tailwindlabs/tailwindcss #15791 - init process not available - GitHub
  • Problem installing TailwindCSS after "npx tailwindcss init -p" command - StackOverflow
  • How to upgrade TailwindCSS? - StackOverflow
  • Deprecated: preprocessors support - StackOverflow

Changed npx tailwindcss to npx @tailwindcss/cli

The command to run is now no longer npx tailwindcss but npx @tailwindcss/cli.

PostCSS plugin and CLI are separate packages — the main tailwindcss package doesn't include these anymore since not everyone needs them, instead they should be installed separately using @tailwindcss/postcss and @tailwindcss/cli.


Source: Open-sourcing our progress on Tailwind CSS v4.0 - Whats changed

This is basically only necessary if you're not using it with a framework and want to run it from the command line. For this, a standalone @tailwindcss/cli package will help from v4 onwards.

npm install tailwindcss @tailwindcss/cli

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745253130a4618796.html

相关推荐

  • tailwind css - Can't install TailwindCSS 4 standalone - Stack Overflow

    Trying to install Tailwind 4.0 full standalone CLI following their own documentation here:Standalone CL

    2小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信