Installation of old version of TailwindCSS failed | Error: Unable to load PostCSS "tailwindcss" plugin: Module 'tailwindcss' not found
P粉574695215
P粉574695215 2023-09-11 14:07:53
0
1
740

I'm working on a project where I can't use the latest version of TailwindCSS due to node version, so I need to install an older version (v2.2.19). Therefore, I installed the following versions of the packages:

tailwindcss: "^2.2.19"
postcss: "^8"
autoprefixer: "^9"

I have a postcss.config.js file:

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
}

But I encountered the error: "Error: Failed to load PostCSS "tailwindcss" plugin: module 'tailwindcss' not found"

Does anyone know how I can solve this problem? Thanks in advance.

P粉574695215
P粉574695215

reply all(1)
P粉647449444

I had a similar problem, I was working on a legacy project in which I was using node version 10. Since tailwindcss requires node version 12^, we cannot use this version in the project.

The only solution I found was to use the standalone tailwindcss CLI. You can take advantage of all the latest features in tailwindcss, but you need to have the CLI file in your project.

Here you can find documentation on using the standalone CLI in your projects. And here is the link to download the latest version of the standalone CLI.

I tried it on a Ruby on Rails project and it worked fine for me.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template