nuxt-modules / tailwindcss

Tailwind CSS module for Nuxt

Home Page:https://tailwindcss.nuxtjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install --omit=dev FAILS

MarioAda opened this issue · comments

Version

@nuxtjs/tailwindcss: 6.11.4
nuxt: 3.10.3

Steps to reproduce

  1. Create a new Nuxtjs application using npx nuxi@latest init
  2. Run npm install -D @nuxtjs/tailwindcss
  3. Add '@nuxtjs/tailwindcss' to modules in nuxt.config (optional)
  4. Run npm install --omit=dev

What is Expected?

Successful install

What is actually happening?

We get an error
Cannot find module '/var/app/staging/@nuxtjs/tailwindcss'

In a production environment, it's common NOT to install development dependencies, hence the npm install --omit=dev, but that fails in Nuxt.

This also applies to plugins of Tailwindcss, and even other modules like ESLINT.

We're forced to run npm install or move everything from devDependencies to dependencies.

This error makes sense though, right? If you're omitting dev dependencies and trying to start a Nuxt dev server that uses module dependencies listed there, it wouldn't work. I think you're looking to run a build/preview or move the modules to dependencies.

Let me know what you think.

We're not trying to start a "dev" server though. We're installing non dev packages to start a prod server for ssr