How to import css file from node_modules?

One way to solve this could be to update the import statements to point to the correct location of the CSS files. Try changing the import statements to:

@import '../../node_modules/tailwindcss/base.css';
@import '../../node_modules/tailwindcss/components.css';
@import '../../node_modules/tailwindcss/utilities.css';

The .. in the path moves up one directory level from the current file location, and then we can navigate to the node_modules folder and the corresponding CSS files.

Hope this will help you out.

Thank you.

1 Like