Vue project to build the next node using cnpm

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"****

Here Insert Picture Description
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
Here Insert Picture Descriptionfront 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
Here Insert Picture Description
the following I have selected these n, can be re-installed will

Select NO I will Handle that myself
carriage
Here Insert Picture DescriptionThis concludes proceeds to the next step

Here Insert Picture Description
Then just built into the project enter cmd command
cnpm install

It will be installed soon dependencies
Here Insert Picture Description

Building completion
enter the command:
npm RUN dev
Here Insert Picture Description

Released six original articles · won praise 5 · Views 356

Guess you like

Origin blog.csdn.net/qq_42840001/article/details/105045816
Recommended