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

How to run vue.js

藏色散人
藏色散人Original
2020-12-25 09:40:269534browse

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

3 on the command line. Install webpack

npm install webpack -g

4. Install vue-cli

cnpm install vue-cli -g

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/项目名称

Then, after entering the project, install the dependencies

npm install

And then

npm run dev

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!

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
Previous article:How to use jquery in vueNext article:How to use jquery in vue