当前位置:网站首页>Nuxt - create nuxt app

Nuxt - create nuxt app

2022-06-22 18:02:00 Wangjiabin

Preface

Be careful : This article uses create-nuxt-app Scaffold version is 4.0 , Other versions can also be used as a reference , Because it hasn't changed much .

First of all, you should ensure that the front-end environment is normal ,

There are no problems such as wrong packing report , Otherwise you need to solve these problems first .

First step

Be careful : Before that , You must ensure that you have installed npx(npx stay NPM edition 5.2.0 Installed by default ).

First , We need to use the scaffolding provided by the frame (create-nuxt-app) To create a project ,

Open anywhere cmd terminal , Execute the following create command :

npx create-nuxt-app project

Project name: project, If the creation fails, use yarn command .

The second step

After successful execution , The interface shown in the figure below will appear , Input y enter :

 Insert picture description here

Then wait patiently for the installation of scaffold .

 Insert picture description here

The third step

Be careful : The project name should not be marked with Chinese characters , Otherwise, unexpected mistakes may be caused .

Let's enter the project name , After that, press enter , As shown in the figure below :

 Insert picture description here

You are using JS Development or use TS Development ? Up and down arrows move , Press enter after selection .

 Insert picture description here

You use npm Or use it yarn Management package ?

 Insert picture description here

What do you use UI frame ?

 Insert picture description here

You choose Nuxt.js modular ( You can also join in the project later ), Suggested choice Axios.

 Insert picture description here

Which code checking tool do you use ? If not, it is recommended to enter directly .

 Insert picture description here

What test framework do you need to use ? Recommended election None, Give Way Nuxt I default to one .

 Insert picture description here

You choose a rendering mode ( important ), If you don't understand , Please refer to This article .

If you are in a hurry and have no time to read , Please select "Universal(SSR / SSG)"

 Insert picture description here

You select a deployment target , Most of them are server-side deployment , If you don't understand, choose the first one .

 Insert picture description here

You select the deployment tool , If you don't understand, just press enter without selecting .

 Insert picture description here

you Github name ? Just go straight back .

 Insert picture description here

Choose your favorite version control system , recommend Git.

 Insert picture description here

Be accomplished , Just wait patiently .

Run the project

The project configuration and creation have been completed , This time let's run .

Wait for the creation , We will receive the following command :

Be careful : If you are npm, Is displayed npm xxx

 Insert picture description here
We followed the instructions , Execute sequentially :

cd project
yarn dev

 Insert picture description here
Then wait .


After successful compilation , As shown in the figure below :

 Insert picture description here
Open the returned link (http://localhost:3000/), Success is shown below :

 Insert picture description here

原网站

版权声明
本文为[Wangjiabin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221621032425.html