Back to Egg

create-egg

tools/create-egg/README.md

4.0.101.9 KB
Original Source

create-egg

Fork and refactor from create-vite

Scaffolding Your First Egg.js Project

Compatibility Note: Egg.js requires Node.js version 20.19+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.

With NPM:

bash
npm create egg@latest

With Yarn:

bash
yarn create egg

With PNPM:

bash
pnpm create egg

Then follow the prompts!

You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Egg.js + TypeScript project, run:

bash
# npm 7+
npm create egg@latest my-egg-app -- --template tegg

# yarn
yarn create egg my-egg-app --template tegg

# pnpm
pnpm create egg my-egg-app --template tegg

Currently supported template presets include:

  • tegg
  • egg3-tegg
  • egg3-simple-js

You can use . for the project name to scaffold in the current directory.

Community Templates

Check out Awesome Egg.js for community maintained templates that include other tools or target different frameworks. You can use a tool like degit to scaffold your project with one of the templates.

bash
npx degit user/project my-project
cd my-project

npm install
npm run dev

If the project uses main as the default branch, suffix the project repo with #main

bash
npx degit user/project#main my-project

MIT