Using Tailwind with local

Hi there, using the latest local app, I am unable to install node packages such as tailwind.


{

  "name": "My Site",

"version": "1.0.0",

"description": "Custom WordPress theme with Tailwind CSS and GSAP",

"scripts": {

"dev": "tailwindcss -i ./src/input.css -o ./style.css --watch",

"build": "tailwindcss -i ./src/input.css -o ./style.css --minify"

  },

"dependencies": {},

"devDependencies": {

"tailwindcss": "^3.4.0",

"postcss": "^8.4.31",

"autoprefixer": "^10.4.16"

  }

}

When I run npm run dev, this installs node_modules but the packages it installs are empty.

I am building a custom WordPresss theme using tailwind. I need to define global styels in my src/input.css which i can use in my php template snippets such as

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom styles go here */
@layer components {
	.btn-primary {
		@apply bg-green-600 text-white px-6 py-2 rounded-lg font-semibold hover:bg-red-700 transition-colors;
	}

	.btn-secondary {
		@apply bg-gray-200 text-gray-900 px-6 py-2 rounded-lg font-semibold hover:bg-gray-300 transition-colors;
	}
}


for:


  <a href="<?php echo get_field('cta_button_link') ?: site_url('/blog'); ?>" class="btn-primary bg-white text-blue-600 hover:bg-gray-100">

            <?php echo get_field('cta_button_text') ?: 'Start Reading'; ?>

</a>

Thank you for helping out

Please can you check you are running Local 9.2.6 or higher and upgrade if not?

We released a fix in that version to make sure that NODE_ENV is set to development instead of production (so that dev deps like tailwindcss are installed correctly during npm install).

If that doesn’t help, you might try npm install --loglevel verbose to see if there’s any explanation for the missing folders.