当前位置:网站首页>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 :
边栏推荐
- Mutex of thread synchronization (mutex)
- How to use EEPROM in 51 Single Chip Microcomputer?
- Swagger
- win10 系统打开的软件太小,如何变大(亲测有效)
- Lua grammar explanation
- 捕获数据包(Wireshark)
- Li Kou 79 word search
- Development prospect and investment strategic planning report of global and Chinese PVC hose industry from 2022 to 2028
- VHDL设计
- I/o virtualization technology - UIO framework
猜你喜欢
Threejs专用天空盒素材,五种天空盒素材免费下载
Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]
Dix critères de base importants pour les essais de débogage de logiciels
[Flink] Flink batch mode map side data aggregation normalizedkeysorter
Construction of art NFT trading platform | NFT mall
Matplotlib line chart, text display, win10
How to use EEPROM in 51 Single Chip Microcomputer?
Oracle technology sharing Oracle 19.14 upgrade 19.15
Custom parameter QR code picture combined with background picture to generate new picture node environment
YOLOv5改进:更换骨干网(Backbone)
随机推荐
Parse JSON interface and insert it into the database in batch
A brain map to summarize the needs analysis (a supplement to the actual situation at work)
軟件調試測試的十大重要基本准則
CTF serialization and deserialization
WPF 值转换
MySQL enable logbin in Qunhui docker
win10 系统打开的软件太小,如何变大(亲测有效)
Sorting out the knowledge points of the renderview renderobject parentdata of the shuttle
But the Internet began to have a new evolution and began to appear in a new state
Verrouillage de lecture et d'écriture pour la synchronisation des fils
第 4 篇:绘制四边形
Analysis of the principle of obxwidget
Custom parameter QR code picture combined with background picture to generate new picture node environment
Development trend and prospect forecast report of China's financial industry 2022-2028 Edition
I/o virtualization technology - UIO framework
Force buckle 515 Find the maximum value in each tree row
How much do you make by writing a technical book? To tell you the truth, 2million is easy!
Matplotlib multi line chart, dot scatter chart
NFT creation and binding of BSC and HT chains
VHDL design