Home >Web Front-end >Vue.js >How to install vue using npm

How to install vue using npm

藏色散人
藏色散人Original
2020-11-13 11:40:367649browse

How to install vue with npm: first download node.js; then install the Taobao mirror npm through the command; then install Vue through the command "npm install -g @vue/cli"; finally create the vue project.

How to install vue using npm

Recommended: "vue.js Tutorial"

1. Download node.js

Official download address: https://nodejs.org/en/download/

Select the corresponding version to install

After the download is completed, the next installation is completed.

General environment variables will be added automatically, open the command line to test whether the installation is successful

2. Install cnpm

Use the following command to install Taobao Mirror npm

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

After the installation is completed, use the npm -v command to test whether the installation is successful.

3. Install Vue

Globally install Vue CLI 3.X version

npm install -g @vue/cli

Wait for the installation to be completed, then use vue -V Check the version number and use the vue --help command to get help.

4. Create a project

Create a new directory and enter the current working environment.

vue create [project-name]

Functions can be selected: use spaces to check and press Enter to end.

Detailed configuration:

After the project is created, the startup method will be displayed.

Start the project

cd [project目录]
npm run serve

The page is displayed on the web page, and the vue project is successfully created.

The above is the detailed content of How to install vue using npm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn