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粉6474494442023-09-12 12:58:59
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.