Closed mnk179 closed 3 years ago
npm install tw-elements
I had this issue today, the fix I found was to remove the @tailwindcss/plugin and instead use const plugin = require("tailwindcss/plugin");
This fixed my not found issue
Anyone have an update on a proper fix for this? Nothing here works for me.
I was running into this problem. I don't believe it is an issue with TailwindCSS itself, but rather the order of dependencies in your package.json. It appears that node orders the dependencies in alphabetical order.
Meaning even if you npm i tailwindcss
and then npm i @tailwindcss/forms
in the correct order, node places @tailwindcss/forms
before tailwindcss itself.
"dependencies": {
"@headlessui/react": "^1.7.7",
"@heroicons/react": "^2.0.13",
"@next/font": "13.1.1",
"@tailwindcss/forms": "^0.5.3",
"autoprefixer": "^10.4.13",
"next": "13.1.1",
"postcss": "^8.4.20",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "^3.2.4",
}
My resolution.. manually move @tailwindcss/forms
below tailwindcss
. It makes sense? In the former order /forms is unable to finish because tailwindcss hasn't been initialized. Didn't test on new code to confirm, but I believe this is the fix.
"dependencies": {
"@headlessui/react": "^1.7.7",
"@heroicons/react": "^2.0.13",
"@next/font": "13.1.1",
"autoprefixer": "^10.4.13",
"next": "13.1.1",
"postcss": "^8.4.20",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "^3.2.4",
"@tailwindcss/forms": "^0.5.3"
}
For clarification we need:
"tailwindcss": "^3.2.4",
"@tailwindcss/forms": "^0.5.3"
and not this:
"@tailwindcss/forms": "^0.5.3"
"tailwindcss": "^3.2.4",
I'm beginer with tailwind, I followed by documentation. And had same issue.
My fix was:
npm install -D @tailwindcss/forms
None of the solutions here worked for me. In my case tailwindcss was installed as global package (npm install -g
)
And it appears that node does not look for requires in global location. The solution was to do this
export NODE_PATH=$(npm root -g)
I'm getting this error when building a project with:
tailwind.config.js
: