vue project to build a node.js

First, install node.js

1. Download the installation package

https://nodejs.org/en/download/, select the corresponding system version, the default installation

ps: This article x64 system installed version of windows node-v12.14.1-x64.msi

2. Open the cmd window to see if the installation was successful

View installed version node -v
view the version npm npm -v (version nodejs now been integrated npm so no need to install)
Here Insert Picture Description

3. Install cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

Here Insert Picture Description

Second, the project to build VUE

1. Scaffolding mounting vue vue-cli

#安装
cnpm install -g vue-cli
#安装完成后查看vue版本(注意命令中是大写的V)
vue -V 

2. Initialize vue project

#cd 到创建的目录下面
cd C:\Users\Administrator
#执行创建
vue init webpack my-project

# Follow the prompts to select the following figure
Here Insert Picture Description
explained:

          Project name 项目名称
      Project description 项目名描述
      Author 作者邮箱
          Vue项目构建:运行+编译还是仅运行
          是否安装vue-router?
      Use ESLint to lint your code? 是否需要ESlist语法检查
      Setup unit tests? 是否需要单元测试
      Setup e2e tests with Nightwatch? 是否需要e2e测试
          是否在项目创建成功后自动执行“npm install”安装依赖

3. Run Project

Excuting an order

npm run dev

Given as follows:
Here Insert Picture Description
solution: cd to the project directory, execute cnpm install install its dependencies
Here Insert Picture Description

4. Run the project again, the browser visit http: // localhost: 8080, appeared vue page is created successfully

Here Insert Picture Description

Published 20 original articles · won praise 32 · views 5562

Guess you like

Origin blog.csdn.net/shuai8624/article/details/104068611
Recommended