Vue project to build the next node using cnpm
Just learned about the case after installation records forget
Installation node.js (small installation package, go to the official website to download directly like), a little higher version already contains a vue.
npm install the module to access the Internet, the speed will be very slow, so the first installation cnpm (domestic Mirror)
1, and set the global module directory cache module
command:
****npm config set prefix "E:\tian\soft\node_global"
npm config set cache"E:\tian\soft\node_cache"****
Then set the environment variable
2, was added NODE_PATH system environment variables, input path:
E: \ tian \ soft \ node_global \ node_modules (node_modules just set in the global module below)
Second,
install cnpm command:
npm install -g cnpm --registry=https://registry.npm.taobao.org
Installation vue scaffolding
npm install vue-cli -g
Then you can use cnpm the
installation cnpm webpack otherwise it will be very slow
I installed webpack is 3.12.0;
The WebPACK 3.x and webpack-cli version 3.x mounted in a package do not need to install a webpack-cli;
Install version 4.x need to manually install webpack-cli
So you need to specify the installed version
@ Version is designated
'-g' is installed globally
Command: cnpm install [email protected] -g
view version webpack -v
The last building project using npm and cnpm:
They want to be stored in the project directory vue enter cmd
enter the command: vue init webpack
front with a question mark will have to fill, you can look at the English to understand, are some of the basic information, like the name of the author of the project,
and finally the choice, I the following selected
Enter
the following I have selected these n, can be re-installed will
Select NO I will Handle that myself
carriage
This concludes proceeds to the next step
Then just built into the project enter cmd command
cnpm install
It will be installed soon dependencies
Building completion
enter the command:
npm RUN dev