프론트엔드✏️/개인공부

[Next.js] tailwind 설치

당근먹는하니 2023. 1. 19. 17:30
728x90
반응형

 

 

tailwind가 components 밑에 있는 파일에는 적용이 안됐다.

해결책을 찾다가 Next.js에서의 사용방법이 자꾸 눈에 띄어서 그냥 Next.js로 하기로 했다.

 

tailwind 때문은 아니고 앞으로 프로젝트를 넥스트로 할 일이 더 많을 것 같아서,,

넥스트 설치하는 건 정말 오랜만이다...! 

 

yarn create next-app --typescript

그냥 타입스크립트로 했다. 

 

yarn dev

터미널에 치면 Next.js 화면이 뜨는 걸 확인할 수 있다.

 

yarn add -D tailwindscss postcss autoprefixer
npx tailwindcss init -p

난 ./src/...로 했다. 

Cannot find module 'tailwindcss' error 
 
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

이걸 해주니 됐다. 

 

 

https://bobbyhadz.com/blog/javascript-cannot-find-module-tailwindcss

 

Cannot find module 'tailwindcss' error [Solved] | bobbyhadz

To solve the error "Cannot find module 'tailwindcss'", install `tailwindcss`, `postcss` and `autoprefixer` as dev dependencies in your project by running `npm install -D tailwindcss postcss autoprefixer`.

bobbyhadz.com

 

 

+20230515 

tailwind css not working ,,, 적용 안 될 때

.next 폴더 지우고 다시 dev 해보기 

728x90
반응형