3

I am trying out tailwindcss with my Vue project and while I solved some issue I had with the routing (while trying to break down my code into smaller components), I think I broke something else.

The code was compiling before I added my new routes. I can't seem to find what is wrong in this case.

Failed to compile.

./src/components/SiteHeader.vue?vue&type=style&index=0&lang=css& (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SiteHeader.vue?vue&type=style&index=0&lang=css&)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Cannot find module 'tailwindcss'

you can check out this repo, has very few files https://github.com/anaivanm/vue-tw/

Ana Ivan
  • 55
  • 1
  • 5
  • 1
    Everything working fine having downloaded your repo and installed the packages. Had to fix the router config though, the `component` part must be a reference not a string. Could be that your `node_modules` is out of sync with the `package-lock`/`yarn.lock` files and you are missing the tailwind dependency? – yuriy636 Nov 09 '19 at 22:45
  • I did fix that. Removed the quotes. Restarted the server and I still had that error. I don't really know how to sync node_modules, but I'll just clone the repo again and give it a shot. Thank you! – Ana Ivan Nov 10 '19 at 09:12

1 Answers1

2

First :

npm run dev

Then

npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

For More Info : Tailwind Docs

Also check this out :Restarting NPM