Modern.js provides @modern-js/create
tool for creating project templates provided by Modern.js, including Web App, Npm Module.
The following will introduce how to use @modern-js/create
.
Before getting started, you will need to install Node.js, and ensure that your Node.js version is higher than 16.2.0. We recommend using the LTS version of Node.js 18.
You can check the currently used Node.js version with the following command:
If you do not have Node.js installed in your current environment, or the installed version is lower than 16.2.0, you can use nvm or fnm to install the required version.
Here is an example of how to install the Node.js 18 LTS version via nvm:
Both nvm and fnm are Node.js version management tools. Relatively speaking, nvm is more mature and stable, while fnm is implemented using Rust, which provides better performance than nvm.
It is recommended to use pnpm to manage dependencies:
Modern.js also supports dependency management with yarn
and npm
.
@modern-js/create
You do not need to install @modern-js/create
globally, just use npx to run it:
[projectDir]
is the project directory name. If it is not filled in, the project will be created in the current directory.
During the execution, complete the interaction according to the prompt to create a project that meets your requirements.