当前位置:网站首页>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 :

边栏推荐
- Question brushing record day01
- 外包干了四年,人直接废了。。。
- 钉钉开放平台-小程序开发实战(钉钉小程序客户端)
- 解析JSON接口并批量插入到数据库中
- Development trend and prospect forecast report of China's financial industry 2022-2028 Edition
- After four years of outsourcing, people are directly abandoned...
- Analysis report on development status and future trend of CMOS image sensor industry in China 2022 ~ 2028
- 線程同步之讀寫鎖
- [Qunhui] command line acme SH automatically apply for domain name certificate
- Computer network high frequency interview questions
猜你喜欢

35岁程序员炒Luna 千万资产3天归零,网友:和赌博一样

Zeromq from getting started to mastering
![Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]](/img/9c/7af92e6ef907b443d974275614e51a.jpg)
Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]

Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优

【QT】对话框dialog

CTF serialization and deserialization

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)

钉钉开放平台-小程序开发实战(钉钉小程序服务器端)

High performance computing center roce overview

Nailing open platform - applet development practice (nailing applet server side)
随机推荐
Analysis report on the development trend and operation status of China's environmental monitoring instrument industry from 2022 to 2028
CTF PHP audit bypasses filtering learning from topics
VHDL设计
[Qunhui] import certificate
[Flink] Flink batch mode map side data aggregation normalizedkeysorter
What should I do if I don't understand the precious metal indicators
CTF serialization and deserialization
解析JSON接口并批量插入到数据库中
Chrome page recording and playback function
Threejs专用天空盒素材,五种天空盒素材免费下载
Analysis report on development trend and market demand of global and Chinese molecular diagnostics industry from 2022 to 2028
Matplotlib line chart, text display, win10
[QT] resource file import
线程同步之条件变量
Go time package: second, millisecond, nanosecond timestamp output
Analysis of the principle of obxwidget
Spark - 一文搞懂 parquet
Principle and implementation of syn cookie
Detr3d multi 2D picture 3D detection framework
Knowledge of functions

