Home > Web Front-end > Vue.js > How to run vue.js

How to run vue.js

藏色散人
Release: 2023-01-13 00:44:59
Original
9603 people have browsed it

How to run vue.js: First set up the environment; then enter the project through the command "cd desktop/project name"; then install the dependencies through the command "npm install"; finally use the command "npm run dev" to run Project is enough.

How to run vue.js

The operating environment of this tutorial: windows7 system, vue2.0 version, Dell G3 computer.

[Related article recommendations: vue.js]

Run vue project (github project)

Installation node.js

Download and install node from the node.js official website. The installation process is very simple, just "next step" all the way (foolish installation).

After the installation is completed, open the command line tool and enter node -v. The npm package manager is integrated in node. Therefore, if you directly enter npm -v, npm will be displayed as shown in the figure. Version Information. As shown in the figure below, if the corresponding version number appears, the installation is successful.

How to run vue.js

How to run vue.js

2. Install cnpm

Because some npm resources are blocked or foreign resources The reason often causes failure when using npm to install dependency packages. So I also need the domestic image of npm ---cnpm

and enter npm install -g cnpm --registry= on the command line. http://registry.npm.taobao.org

If the installation fails under mac and prompts that the permissions are insufficient, enter

sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
Copy after login

3 on the command line. Install webpack

npm install webpack -g
Copy after login

4. Install vue-cli

cnpm install vue-cli -g
Copy after login

This process will take more than ten seconds, just wait until it is finished

, now the entire environment is set up, then run the project

First

cd desktop/项目名称
Copy after login

Then, after entering the project, install the dependencies

npm install
Copy after login

And then

npm run dev
Copy after login

At this time you will see that the project has been run in the browser.

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

Related labels:
vue
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template