How to get the project up and running vue (example: Ali short video uploads vue version demo)

How to get the project up and running vue (example: Ali short video uploads vue version demo)

In cmd as follows:
Node -v
NPM -v

As some npm some reason blocked resources or foreign resources, often resulting in the installation of dependencies with npm fails, all I need npm domestic CNPM mirror ---
CNPM -v error, cnpm not an internal command. Solution is as follows:
Installation CNPM
https://jingyan.baidu.com/article/9080802239521cfd90c80f55.html

Once complete, we can use cnpm to install the dependencies instead of npm.
How to get the project up and running vue (example: Ali short video uploads vue version demo)

Installation vue-cli scaffold build tool
cnpm install -g vue-cli

How to get the project up and running vue (example: Ali short video uploads vue version demo)

安装webpack
cnpm install webpack -g

How to get the project up and running vue (example: Ali short video uploads vue version demo)

Enter someone else's (or downloaded online) vue project. Note: First, to delete others vue project inside node_modules, or will install error!

How to get the project up and running vue (example: Ali short video uploads vue version demo)

Required dependencies to install Project:
CNPM install

How to get the project up and running vue (example: Ali short video uploads vue version demo)

Well, vue needed for the project environment and dependence are fitted.
Everything is ready to start the project
cnpm run dev

How to get the project up and running vue (example: Ali short video uploads vue version demo)

Well, congratulations: incorrect report: node_env not an internal or external command .......
Baidu reason: compatibility issues with windows front-end node implementation of the project, the windows do not support NODE_ENV = set way of development, in this operation in powershell is not supported, and is not supported in cmd, it is a Mac or Linux bash shell in a unique operation.

Solution: Install the across-env solve cross-platform issues
CNPM install Cross-env --save-dev
https://www.cnblogs.com/zhishaofei/p/8441032.html

How to get the project up and running vue (example: Ali short video uploads vue version demo)

Ali modifications in the project file package.json:
1, in front of all NODE_ENV plus cross-env (note the space left between the two).
2, Ali this project up and running by default ip is 0.0.0.0, wanted to change the ip of your computer, otherwise open. (My local computer IP is 192.168.0.120)
How to get the project up and running vue (example: Ali short video uploads vue version demo)

Modify Well, then try again: Let's Go to start
D: \ ali \ cnpm run dev
How to get the project up and running vue (example: Ali short video uploads vue version demo)

In the browser input given access link address: http://192.168.0.120:3000/
How to get the project up and running vue (example: Ali short video uploads vue version demo)

ok perfect, it took nearly two hours to finally Ali upload short video demo version vue run up, and before I mainly engaged in the back-end and interfaces, it seems that I can walk around the front end. let's go. . . . . .

More will a new technology to compete one more weapon than the others, more than one way.

Guess you like

Origin blog.51cto.com/xuqin/2428305