title: Tailwind in React project - getting "Cannot find module 'autoprefixer'" error during setup
body: <p>I'm following the documentation for setting up Tailwind in a React project over on <a href="https://tailwindcss.com/docs/guides/create-react-app" rel="noreferrer">https://tailwindcss.com/docs/guides/create-react-app</a>. I've been following the steps, but when I get to the part where I'm supposed to run <code>npx tailwindcss init</code> in order to generate a <code>tailwind.config.js</code> file, I get the following error:</p>
  <pre><code>Cannot find module 'autoprefixer'
  Require stack:
  - C:\Users\[user]\AppData\Roaming\npm-cache\_npx\16096\node_modules\tailwindcss\lib\cli\commands\build.js
  - C:\Users\[user]\AppData\Roaming\npm-cache\_npx\16096\node_modules\tailwindcss\lib\cli\commands\index.js
  - C:\Users\[user]\AppData\Roaming\npm-cache\_npx\16096\node_modules\tailwindcss\lib\cli\main.js
  - C:\Users\[user]\AppData\Roaming\npm-cache\_npx\16096\node_modules\tailwindcss\lib\cli.js
  </code></pre>
  <p>I've checked that I have <code>autoprefixer</code> in my <code>node_modules</code> folder and tried reinstalling it, but I get the same error. In my <code>package.json</code>, I have the following:</p>
  <pre><code>...
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;craco start&quot;,
      &quot;build&quot;: &quot;craco build&quot;,
      &quot;test&quot;: &quot;craco test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
  ...
  </code></pre>
  <p>as per the documentation. My <code>craco.config.js</code> file is as follows:</p>
  <pre><code>module.exports = {
    style: {
      postcss: {
        plugins: [
          require('tailwindcss'),
          require('autoprefixer'),
        ],
      },
    },
  }
  </code></pre>
  <p>again, as per the documentation. I've also tried reinstalling the <code>@craco/craco</code> package to no avail, so at this point I'm stuck. Any help would be appreciated.</p>