Npm run build failure with Tailwind - sh: postcss: command not found

Hello! I just started a Tailwind course on Udemy. I have followed the instructions as perfectly as I knew how and am getting this error when I do npm run build:

kimberlybrooke@Kimberlys-MacBook-Pro miniproject % npm run build

miniproject@1.0.0 build /Users/kimberlybrooke/Udemy_tailwindcss/miniproject
​postcss​ tailwind.css -o dist/css/styles.css

sh: ​postcss​: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! miniproject@1.0.0 build: ​postcss​ tailwind.css -o dist/css/styles.css
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the miniproject@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kimberlybrooke/.npm/_logs/2021-07-24T20_13_18_544Z-debug.log

Any thoughts? Thanks!

It looks like you might be missing a dependency required by tailwind. You could try running npm install -D postcss in the directory where your package.json is.

1 Like