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.
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.
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!