当前位置:网站首页>Nodejs NPM common instructions summary
Nodejs NPM common instructions summary
2022-07-27 22:30:00 【proud1212】
npm What is it?
npm: Full name Node Package Manager javascript Project package management download tool , It's with NodeJS Package management and distribution tools installed together , It can be easily downloaded by front-end developers 、 install 、 Upload and manage installed packages .
Use npm The premise of
- First we need to install Node
- Official website download Nodejs https://nodejs.org/zh-cn/download/
- Download and install , It can be used after installation npm
npm Some common instructions
1. see npm Version of
npm -V
2. npm Taobao mirror ( When downloading files, Caton needs to use Taobao image )
Set global npm Taobao mirror
npm config set registry https://registry.npm.taobao.org
You can also switch back to the default global image
npm config set registry https://registry.npmjs.org
3. npm Common command abbreviations
-g: by --global Abbreviation , Indicates that it is installed in the global directory
-S: by --save Abbreviation , Indicates that the installed package will be written to package.json Inside dependencies
-D: by --save-dev Abbreviation , Indicates that the package to be installed will be written to packege.json Inside devDependencies
i: by install Abbreviation , Said the installation
4. initialization
npm init
Initialize project establish package.json The file of
npm init -y
Quick initialization project
5. uninstall uninstal
uninstall jquery
npm uninstall jquery
Abbreviation ( Alias )
uninstall --- remove/r
6. install
General installation
install jquery
npm i jquery
Specify version installation Install fixed version jQuery
npm i [email protected] -S
Global installation
Any item of the computer can be referenced to the plug-in
Global installation vue
npm i @vue/cli -g
The location of the global installation of plug-ins
npm root view -g
Development and installation
The project uses , No need to go online
Development dependent installation axios
npm i axios -D
Product dependent installation
The installed plug-ins are required in both the development and online stages
The product environment depends on installation jquery
npm i jquery -S
7. Version number
^3.6.0 Limit the version range
Project use jQuery Can upgrade However, the scope of upgrade cannot be greater than or equal to 4.0.0
X.Y.Z
X The big version ,X The upgrade of is incompatible
3.6.0->4.0.1 Use 3.6.0 And now 4.0.1 Incompatible items for
Y Medium version ,Y The upgrade of represents an addition of new content ( Compatible )
Z Small version , Often repair bug error
8. An updated version
to update jQuery
npm Update jquery
Alias update --- up
边栏推荐
- Excel only wants to visualize charts and make data move? Yes, come and watch (with a large number of templates to download)
- Alibaba Senior Software Testing Engineer recommends testers to learn -- Introduction to security testing
- vs2019 release模式调试:此表达式有副作用,将不予计算。
- What is modcount in the source code? What's the effect
- CMOS开关(二)_参数提取
- 一种比读写锁更快的锁,还不赶紧认识一下
- 项目管理工具禅道
- [C language] high precision addition, subtraction, multiplication and division template
- leetcode383赎金信
- Learn the use principle and core idea of thread pool from the source code
猜你喜欢

Kubernetes二进制部署——理论部分

leetcode383赎金信

Interview question: talk about your understanding of AQS

Reed relay

温度继电器

Relationship between DBM and VPP and Vpeak

中职磐云网络安全大赛-------隐藏信息探索

A lock faster than read-write lock. Don't get to know it quickly

Credit default prediction based on simplified scorecard, smote sampling and random forest

Starfish Os X MetaBell战略合作,元宇宙商业生态更进一步
随机推荐
Project analysis (what is it training that can't be given)
How to customize logging of.Net6.0
Deploy dolphin scheduler high availability cluster based on rainbow
Reed relay
vs2019 release模式调试:此表达式有副作用,将不予计算。
Are Transformers Effective for Time Series Forecasting?|填坑
【StoneDB故障诊断】MDL锁等待
每条你收藏的资讯背后,都离不开TA
What is the employment prospect of software testing?
electromagnetic relay
极化继电器
【sql】SQL优化
Nine days later, we are together to focus on the new development of audio and video and mystery technology
The gratitude and resentment between the four swordsmen and code review: "abandon all chaos" to "prodigal son returns"
舌簧继电器
Polarization relay
软件测试的就业前景到底怎么样?
Vs2019 release mode debugging: this expression has side effects and will not be evaluated.
CMOS switch (II)_ Parameter extraction
CMOS传输门原理及应用