1. 프로젝트 생성하기
- 타입스크립트 X
npx create-next-app@latest
# or
yarn create next-app
# or
pnpm create next-app
- 타입스크립트 O
npx create-next-app@latest --typescript
# or
yarn create next-app --typescript
# or
pnpm create next-app --typescript
2. next, react, react-dom 설치하기
npm install next react react-dom
# or
yarn add next react react-dom
# or
pnpm add next react react-dom
3. npm 설치하기
- 안하면 script 실행 시, "'next'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다." 이런 오류가 뜬다.
npm install
4. 서버 실행하기
npm run dev
5. 접속하기
- 보통 http://localhost:3000/ 로 뜨긴 한다.
- 터미널 창에도 뜨니 확인하고 접속하면 된다.


Getting Started | Next.js
Get started with Next.js in the official documentation, and learn more about all our features!
nextjs.org
'Library-Framework > Next.js' 카테고리의 다른 글
[Next.js] Google Maps API로 지도에 원 그리기 (당근마켓 내 동네 설정 따라해보기) (0) | 2023.06.28 |
---|---|
[Next.js] 번역 기능 (다국어) 적용하기 (i18next) (0) | 2023.05.16 |