当前位置:网站首页>NPM installation tutorial
NPM installation tutorial
2022-06-26 04:17:00 【Never bow】
npm Installation tutorial
One 、 Before use , Let's master it first 3 What is this thing for .
npm: Nodejs Package manager under .
webpack: Its main use is through CommonJS All static resources that need to be published on the browser side should be prepared according to the syntax of , Such as resource merging and packaging .
vue-cli: User generated Vue Engineering formwork .( Help you to start one quickly vue Project , That is to give you a set vue Structure , Include base dependency Library , It only needs npm install Can be installed )
Start :

Pictured , download 8.9.3 LTS ( Recommended for most users )

Double click installation

You can use the default path , In this example, it is changed to d:\nodejs

All the way Next

spot Finish complete


open CMD, Check whether it is normal



Look at the other 2 A catalog ,npm The local warehouse runs in the system disk c Disk's user directory ( I didn't see npm-cache It's because I haven't used it , As soon as the cache directory is used ), We're trying to put this 2 Move directories back to D:\nodejs
First set up as shown in the figure below 2 A catalog
Then run the following 2 Bar command
npm config set prefix "D:\nodejs\node_global"
npm config set cache "D:\nodejs\node_cache"
Pictured above , Let's focus on npm Local warehouse of , Enter the command npm list -global

Enter the command npm config set registry=http://registry.npm.taobao.org Configure mirror station

Enter the command npm config list Show all configuration information , We focus on a profile
C:\Users\Administrator\.npmrc

Edit it with a text editor , You can see the configuration information just now


Check if the mirror station works 1
npm config get registry

Check if the mirror station works 2
Npm info vue See if you can get vue Information about


Be careful , here , Default module D:\nodejs\node_modules Catalog
Will change to D:\nodejs\node_global\node_modules Catalog ,
If it runs directly npm install You'll get an error when you wait for an order .
We need to do 1 thing :
1、 Add environment variables NODE_PATH The content is :D:\nodejs\node_global\node_modules

( Be careful , The next operation needs to be reopened CMD Let the environment variables above take effect )
One 、 test NPM install vue.js
command :npm install vue -g
there -g Means to install to global Global directory to


Two 、 test NPM install vue-router
command :npm install vue-router -g



function npm install vue-cli -g install vue The scaffold


Editor environment editor path

Yes path Environment variable add D:\nodejs\node_global
win10 The following versions of , Horizontal display PATH Of , Note when adding to the last , No semicolons 【;】

Reopen CMD, And test it vue Whether it is in normal use

Be careful ,vue-cli Tools are built-in templates including webpack and webpack-simple, The former is a more complex professional project ,
His configuration is not all in the root directory webpack.config.js in .

initialization , Installation dependency

function npm install Installation dependency

npm run dev

Success interface , Prompt open address http://localhost:8080

Open browser automatically http://localhost:8080/#/

npm run build
Generating static files , open dist New created under folder index.html file
nmp Next new vue01 Directory description for :

边栏推荐
- YOLOv5改进:更换骨干网(Backbone)
- Spark - understand parquet
- 【QT】对话框dialog
- Knowledge of SQL - database design, backup and restore
- High performance computing center roce overview
- VHDL design
- MapReduce execution principle record
- Ipvs0 network card of IPVS
- After four years of outsourcing, people are directly abandoned...
- 六、项目实战---识别猫和狗
猜你喜欢
![[MySQL] MySQL export database](/img/e3/1aa31760dc5447b7c3c0d942644116.jpg)
[MySQL] MySQL export database

Read / write lock for thread synchronization

matplotlib折线图,文字显示,win10

【QT】对话框dialog

win10 系统打开的软件太小,如何变大(亲测有效)

What preparation should I make before learning SCM?

钉钉开放平台-小程序开发实战(钉钉小程序客户端)
![[Nuggets' operation routine disclosure] the routine of being truly Nuggets](/img/42/b4004579fc89f7efcb6b4a4bc7e389.png)
[Nuggets' operation routine disclosure] the routine of being truly Nuggets

MySQL enable logbin in Qunhui docker

小程序中实现视频通话及互动直播功能
随机推荐
WPF value conversion
Analysis report on development trend and market demand of global and Chinese molecular diagnostics industry from 2022 to 2028
mysql自带的性能测试工具mysqlslap执行压力测试
[Qunhui] no port access (reverse proxy + intranet penetration)
Wechat applet is bound to a dynamic array to implement a custom radio box (after clicking the button, disable the button and enable other buttons)
Matplotlib multi line chart, dot scatter chart
【QT】对话框dialog
What preparation should I make before learning SCM?
Analysis of the principle of obxwidget
Analysis report on the development trend and operation status of China's environmental monitoring instrument industry from 2022 to 2028
Knowledge of functions
How much do you make by writing a technical book? To tell you the truth, 2million is easy!
Ipvs0 network card of IPVS
SQL related knowledge - constraints
外包干了四年,人直接废了。。。
Tencent Interviewer: How did binder get its system services?
Read / write lock for thread synchronization
Parse JSON interface and insert it into the database in batch
1. foundation closing
What if the serial port fails to open when the SCM uses stc-isp to download software?

