当前位置:网站首页>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
边栏推荐
猜你喜欢

Multi tenant SaaS cloud platform framework

High frequency relay

Kubernetes二进制部署——理论部分
![[question 22] dungeons and Warriors (Beijing Institute of Technology / Beijing Institute of Technology / programming methods and practice / primary school)](/img/64/70fa9f47836e07dd41d9e283e50adb.jpg)
[question 22] dungeons and Warriors (Beijing Institute of Technology / Beijing Institute of Technology / programming methods and practice / primary school)

Tab bar (addeventlistener and onclick practice, used with bind method, exponential growth to listen for events)

vs2019 release模式调试:此表达式有副作用,将不予计算。

Solid state relay

电磁继电器

饿了么input输入框设置type=‘number‘时,去掉后面的上下按钮

Apachespark command execution (cve-2022-33891) vulnerability recurrence
随机推荐
High frequency relay
【sql】SQL优化
软件测试的就业前景到底怎么样?
cache学习
Implementation of arbitrary code execution based on.Net dynamic compilation technology
基于简化的评分卡、Smote采样和随机森林的信贷违约预测
Leetcode-226-flip binary tree
Drawing three coordinate (axis) diagram with MATLAB
Deepfake 换脸真假难辨,马斯克分克已伪装成功
cocos:ccpDistance函数的简单运用以及实现眼球随着手指在眼眶中转动的功能
Tab bar (addeventlistener and onclick practice, used with bind method, exponential growth to listen for events)
2022 2nd cyber edge cup cyber security competition Web
极化继电器
A lock faster than read-write lock. Don't get to know it quickly
Window localStorage 属性和Location 对象
SQL injection less29 (parameter pollution bypasses WAF)
Apachespark command execution (cve-2022-33891) vulnerability recurrence
【无标题】
【二叉树】统计二叉树中好节点的数目
fork()函数的执行过程、孤儿进程和僵尸进程