1.创建项目
next提供了create-next-app来创建一个next项目,通过npx来调用
npx create-next-app next-app
npx: installed 1 in 6.541s
Creating a new Next.js app in D:\workspace\project\react\next-app.
Using yarn.
Installing dependencies:
- react
- react-dom
- next
yarn add v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
...
Done in 38.97s.
Initialized a git repository.
Success! Created next-app at D:\workspace\project\react\next-app
Inside that d