Tailwind CSS EACCESS Error When Running Project In Node Docker Container (Docker Compose)

Published

I have a project that is using svelte-kit and Tailwind CSS. I recently moved it over to using docker compose. When I run my containers, I run them in WSL because they usually run better there. When I start the container that runs the development server, it starts up and runs just fine, but when I open the URL in my browser, I get the following error.

Error: EACCES: permission denied, mkdir '/root/.tailwindcss/touch'
    at Object.mkdirSync (node:fs:1325:3)
    at Object.<anonymous> (/var/www/html/node_modules/tailwindcss/jit/lib/setupContext.js:44:8)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/var/www/html/node_modules/tailwindcss/jit/index.js:7:22)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)

I’m unsure what’s causing this error but I think it has something to do with tailwind.
Here is a link to my docker-compose file: https://github.com/DriedSponge/GorillianCurrencyConversion/blob/master/docker-compose.yml

If you want to try it out yourself, here is a link to the repo and the steps to reproduce:
https://github.com/DriedSponge/GorillianCurrencyConversion

Install Packages: docker-compose run npm install

Start Dev Server: docker-compose --profile dev up -d --build

Please let me know if you have any ideas on what’s happening, or if you need any additional information from me. Thanks in advance!

Source: Docker Questions

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq