Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module "tailwindcss" when installing with pnpm #849

Closed
MalachiDraven opened this issue May 16, 2024 · 2 comments
Closed

Cannot find module "tailwindcss" when installing with pnpm #849

MalachiDraven opened this issue May 16, 2024 · 2 comments
Labels
question Further information is requested

Comments

@MalachiDraven
Copy link

Following the documentation, installing this module with pnpm as such: pnpm i -D @nuxtjs/tailwindcss . Setting up tailwind.config.ts as:

import type { Config } from "tailwindcss"
import colors from "tailwindcss/colors"

export default <Partial<Config>>{
    theme: {
        extend: {
            colors: {
                primary: colors.green,
            },
        },
    },
}

Getting the following TS errors:
Cannot find module 'tailwindcss' or its corresponding type declarations.ts(2307)
Cannot find module 'tailwindcss/colors' or its corresponding type declarations.ts(2307)

These errors don't occur if using npm or yarn, only with pnpm. I'm new to using pnpm, so did I do something wrong or miss a step?

@MalachiDraven MalachiDraven added the question Further information is requested label May 16, 2024
@14lee
Copy link

14lee commented May 22, 2024

you can create .npmrc file, and write shamefully-hoist=true into the file, reinstall the dependencies.

@ineshbose
Copy link
Collaborator

I think something may be specific to your project/editor; it's difficult to say without looking at the project / getting entire context, but the setup for that is likely outside the scope of this module. You can try using shamefully-hoist with pnpm (but it shouldn't be required). 🙂

@ineshbose ineshbose closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants