tailwindcss: Can't build on Linux ARM -> cannot find module '@tailwindcss/oxide-linux-arm64-gnu'
What version of Tailwind CSS are you using?
4.0.0
What build tool (or framework if it abstracts the build tool) are you using?
Vite 6
What version of Node.js are you using?
22.12.0
What browser are you using?
Occurs in CLI
What operating system are you using?
Ubuntu Linux on arm64
Reproduction URL
/
Describe your issue
When running tsc && vite build the build fails and gives the following error:
error during build:
[vite:css] Failed to load PostCSS config (searchPath: [...]): [Error] Loading PostCSS Plugin failed: Cannot find module '@tailwindcss/oxide-linux-arm64-gnu'
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 38
- Comments: 64 (7 by maintainers)
Commits related to this issue
- fix: package build error https://github.com/tailwindlabs/tailwindcss/issues/15806 이후에 수정될 수도 있습니다. — committed to henein/henein by pdom0327 2 years ago
- chore: add optional dependency for @tailwindcss/oxide-linux-arm64-gnu — committed to rjumatov/portfolio by rjumatov 2 years ago
- chore(frontend): update to tailwind 4.0 with dashboard container file sync closes #1771 Tailwind 4.0 has a dependency that depends on OS specific binaries. See [issue](https://github.com/tailwindlab... — committed to measure-sh/measure by anupcowkur 2 years ago
- chore(frontend): update to tailwind 4.0 with dashboard container file sync closes #1771 Tailwind 4.0 has a dependency that depends on OS specific binaries. See [issue](https://github.com/tailwindlab... — committed to measure-sh/measure by anupcowkur 2 years ago
- Upgrade npm to latest in CI npm version 11.3.0 includes a fix (see: https://github.com/npm/cli/pull/8184) that was pointed out in https://github.com/tailwindlabs/tailwindcss/issues/15806#issuecomment... — committed to Andrew-Chen-Wang/template-nextjs by Andrew-Chen-Wang 2 years ago
- Download platform specific package if `optionalDependencies` are skipped (#17929) Closes #15806 This PR adds a new `postinstall` script to `@tailwindcss/oxide` that will attempt to download the plat... — committed to tailwindlabs/tailwindcss by philipp-spiess 2 years ago
Saw these errors come up on vercel builds.
Added this to my package.json:
And things worked again.
Edit: I realize that my architecture may be different than OP’s, but the technique might be helpful all the same – just replace the package names appropriately.
I experienced the same issue building inside an amd64 docker container. I had to manually
pnpm addthe@tailwindcss/oxide-linux-x64-gnuandlightningcss-linux-x64-gnupackages to run successfully.Agreed
Same issue here, but for macOS locally:
The
optionalDependenciesdoesn’t work for me, at least not usingpnpmandturborepo. And I dislike this method to specify manually these binaries, because every developer that works in the project that owns a different OS will be forced to do this.The best would be a postscript coming from tailwind to decide based on the operating system which binary should be installed, but not as an explicit dependency in package.json.
this did a trick for me
Also seeing this, but on amd64, had to manually add this to my Dockerfile:
For this, you’d could consider replacing the
@importlike so:The
.cssending ensures Sass leaves the@importas-is and ensures Tailwind handles it properly.Now using Node v22.15.0 (npm v11.3.0).
Upgraded to Tailwind CSS v4.1.6 — I can confirm the @tailwindcss/oxide error is gone. However, I’m still seeing the lightningcss error. Upgrading npm did not resolve this one.
DUDE I can’t thank you enough!!
I ran npm install lightningcss-linux-x64-gnu. while in terminal and saw no difference; stopped and started the docker instance and it was WORKING. THANK YOU SO MUCH.
Going to attempt a build with the dockerfile from scratch.
Next up: getting it up on docker hub so I can get it up on a server.
THANK YOU SO MUCH.
Avoid tailwind 4.0.5
clear node_modules and package-lock, npm i, yada yada
I’m receiving a similar error:
I’m using the Next.js framework on M3 (arm64) MacOS. I’m not sure if @Kaishiyoku is building from within a Docker container? I’m building inside an Alpine Linux Docker container, so I suspect that the difference in our error message is just Alpine busybox tooling (
muslbuild libraries) vs Ubuntu’s (gnu) tooling.Is it possible that Tailwind hasn’t setup something for arm64?
Just a note here: We added the
postinstallscript only to theoxidedependency. It can be that the other native extensions (lightningcss,@parcel/watcher) also experience these issues. If you run into issues with this package I recommend the same workarounds as before:@tailwindcss/oxide-*related packages for this anymore.Folks are referencing an issue in npm/cli being a cause for npm users. It seems like a PR was merged, but the team just cut a release a few days ago, so I’d expect about a month before another release is cut
See PR https://github.com/npm/cli/pull/8184
Manually installing
lightningcss-linux-x64-gnu, and@tailwindcss/oxide-linux-x64-gnuin myyamlCI/CD setup file works as a temporary fix.But TW should be able to identify the proper module it needs without manual intervention. Looking forward to an update.
I am developing on Apple M3 Max (arch=arm64, platform=darwin) and therefore this is also the place where I run my
npm install package-xyzcommands, which generate my package-lock.json file. After the development I move over to a CI/CD pipeline based on anode:22-bookwormimage, which turns out to be platform=linux and arch=x64. I was able to solve the problem without downgrading.My versions: next.js 15 react 19 tailwindcss 4.0.14 @tailwindcss/postcss 4.0.14
I am using
npm ci(so only considering package-lock.json) to install the dependencies in the docker container and I was running in exactly the same problems.My resolution worked like this
If you are using npm 8.19.0 or higher.
Reinstall @tailwindcss/postcss on your development using:
npm install --platform=linux --arch=x64 @tailwindcss/postcssIt is possible that you need to ensure that the package-lock.json is been correctly updated, worst case by deleting package-lock.json and node_modules and reinstalling via npm install. After that the package-lock.json contains in addition to arm64 dependencies also the x64 linux dependencies see screenshot.
Change to your platform and arch if you need something different, this should add both optional dependencies for your local environment in my case arch=arm64, platform=darwin and the docker environment linux x64. After that my build are running smooth again.
If you are not using npm 8.19.0 or higher
Try running the install process instead of using
npm ciwithnpm installEnsuring that all optional dependencies are actually matching your target os and and arch. This is not recommended because depending on how you have defined your version it can lead to sideeffects and “auto-upgrades”.
Other option add an additional install command after your installation like
Same “trick” can be applied for other binary packages two, e.g. turbo …
I’m still encountering this issue when running in a container.
Version:
"tailwindcss": "4.0.13"Error:
The optional dependency doesn’t work for me either.
I also have the same issue, and it’s not good at all… Removing
node_modulesandpackage-lock.jsonand then runningnpm ihelps very partially (optionalDependenciesdon’t help) : The issue is that our team all have laptops with different CPUs and OS, and for Jenkins we have even another system. So to make it work, everyone should remove their node_modules and package-lock, and reinstall tailwindcss modules only specific for their systems. And none of them can be used on CI/CD. But usingnpm iwithoutpackage-lock.jsoninstead of a regularnpm cion CI/CD is dangerous due to possible fetching of untested versions of libs, and leads to unpredictable bugs on the production. So, currently there’s no a clean way to deploy it safely.I’m also seeing this issue with pnpm, so it’s not just a npm issue.
Next.JS 15.1.6 TailwindCSS 4.0.4 NodeJS v22 Docker image is running Alpine Linux Running Docker on a M1 Mac
Error
Hey folks! Are you all using
npmor also some other package managers? I’m asking because there’s a known issue right now that platform-specific optional dependencies are not installed right now when doing annpm installwithnode_modulesalready present: https://github.com/npm/cli/issues/4828Some folks have posted workarounds in the lightningcss repo that you could try: https://github.com/parcel-bundler/lightningcss/issues/567.
@t-mart that worked.
I’m using these optional dependencies on ARM now:
Manually installing
@tailwindcss/oxide-linux-arm64-musland rerunning yields a new error:Then I tried installing
lightningcss-linux-arm64-muslAt this point I finally start to get some compilation error tracebacks, but I really doubt that it’s the intention that these packages should have to be manually installed. I suspect there’s some issue detecting which version to install and making it happen along with the default
npm i tailwindcss.I’m still continuing to get some odd deprecation warnings…
and
However, I am able to finally get Tailwind v4.0 “working” after these steps.
EDIT The
punycodedeprecation warning has nothing to do with Tailwind and appears to stem from ESLint (9.19.x). I discovered by doingnpm ls punycodethat it is a dependency of another dependency of another dependency used byeslint—uri-js. This package has not been updated in 4 years. Hopefully ESLint can find a way to replace it with something actively maintained.Hey folks! The next patch release will now include a
postinstallscript that will attempt to correct this issue if it occurs. This in combination with the npm fix should help reduce the number of times this issue occurs quite drastically: https://github.com/tailwindlabs/tailwindcss/pull/17929Please let us know if you still run into any issues. 4.1.6 is expected to ship later today 🤞
Yup, shared above.
Find missing module via log Install package manually for local, or as a CI/CD step for deployed apps.
npm iI truly appreciate the assist as I’m both new to Next.js and Docker (years of a ruby dev).
I don’t know if you need the docker-compose.yaml which show the services (mysql, directus backend and my next.js front end).
The Dockerfile is:
^ Should I flip to 22?
I’ve even sh’d into the docker instance and deleted the node_modules and npm i, and then npm rebuild lightningcss --build-from-source --verbose
I can see that the module is in there now but still getting the error:
And afterward:
Again, I appreciate the attempt to help; I’ve been trying to figure this thing out for days and going around in circles; if it’s a ME thing feel free to tell me what I’m screwing up here.
I’m really at a loss here; I’ve sh’d into my docker instance and even run
I can’t get the proper version of lightningcss to run and it kills my whole frontend; everything runs properly for me locally as npm run but the minute it’s trying to move to docker it borks.
Do you have package-lock.json file, please check if your dependency is listed as an optional dependency. To find the correct binary, which is missing you can run
node -e 'console.log(`npm install --platform=${os.platform()} --arch=${os.arch()} @tailwindcss/postcss`)'which will return on my Mac M3
npm install --platform=darwin --arch=arm64 @tailwindcss/postcssand within my node:22-bookworm docker container
npm install --platform=linux --arch=x64 @tailwindcss/postcssTherefore I need to ensure that my package-lock.json file contains both binaries.
@tehraven that worked for me thank you.
This is a really obscure issue. This has happened so far on local builds and docker builds like others are showing.
Ensuring to remove an existing
node_modules, remove package-lock.json and runnpm updatebeforenpm installresolved my docker image build. It may not be the best way but it worked.Getting a similar issue on our Jenkins box.
Tried adding but no change.
using
node version v22.13.0 Yarn version v1.22.22 vite version v6.1.0 tailwind version v4.0.7
I’m seeing the same issue with deno installing in an alpine container on M4 Mac.
@l00sed I’m building on an Ampere Altra Max server