I am working on a Next.js project with Tailwind CSS, and when I try to run my development server, I get the following error:
Error evaluating Node.js code
Error: Cannot find module '../lightningcss.win32-x64-msvc.node'
Require stack:
- F:\NextJS\basic-nextjs-app\node_modules\.pnpm\[email protected]\node_modules\lightningcss\node\index.js
- F:\NextJS\basic-nextjs-app\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\postcss\dist\index.js
- F:\NextJS\basic-nextjs-app\.next\build\chunks\turbopack\_runtime.js
- F:\NextJS\basic-nextjs-app\.next\transform.js
This error prevents my app from starting properly.
What I Have Tried:
Cleared
node_modulesand reinstalled dependenciesrm -rf node_modules .next pnpm-lock.yaml pnpm install pnpm run dev(I also tried using
npm install, but the error persists.)Manually installed
lightningcsspnpm add lightningcss(Still getting the same error.)
Updated Tailwind CSS and PostCSS
pnpm update tailwindcss postcss(No effect.)
Disabled TurboPack in
next.config.jsconst nextConfig = { experimental: { turbo: false, }, }; module.exports = nextConfig;(But the error still occurs.)
Environment Details:
- Next.js Version: 15.2.4
- Tailwind CSS Version: 4.0.17
- Package Manager: pnpm
- Operating System: Windows
How can I fix this lightningcss module issue in Next.js? Any help is greatly appreciated!