惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

陈少文的网站

巨变与机遇的未来十年 Kubernetes 平台管理软件压力测试方案 使用镜像部署 Hexo 静态页面 终于等到你 - GitHub 镜像仓库服务(ghcr.io) 一起来学 Go --(6)Interface 一起来学 Go --(5)Goroutine 和 Channel 什么是函数式编程 如何在 Kubernetes 集群集成 Kata 柯里化与偏函数 使用 PyGithub 自动创建 Label 软件产品是团队能力的输出 Helm 2 、Helm 3 比较 IoT 变现 Kubernetes 中的 DNS 服务 国内的 Helm 镜像源 Harbor 使用自签证书支持 Https 访问 DevOps 工具链之 Prow 如何使用 kfctl 安装 Kubeflow VS Code 无法下载 Go 插件的工具包 工程师更应具有服务精神 你不知道的 Docker 使用技巧 使用 Docker 运行 Tensorflow 论中国 什么是左移 如何清空 Git 仓库全部历史记录 一禅小和尚 有风吹过厨房 时间的玫瑰 如何在 CentOS 安装 GPU 驱动 开发 Tips(19)
NPM 常用命令
微信公众号 · 2018-06-25 · via 陈少文的网站

** 默认执行命名时,针对的是当前目录环境。如果加上 -g 参数,则表示针对的是全局生效。**

  • npm 升级
  • 查看当前版本
  • 查看 npm 源配置
1
npm config get registry
  • 修改 npm 源
1
2
npm config set registry http://registry.npm.taobao.org/
# npm config set registry https://registry.npmjs.org/
  • 临时指定 npm 安装源
1
 npm install [package name] --registry=https://registry.npm.taobao.org
  • 设置 proxy
1
npm config set proxy http://proxy.example.com:8080
  • 查看 proxy
  • 删除proxy
1
npm config delete proxy
  • 查看所有配置
  • 列出安装的包
  • 安装 packages.json 中描述的包
  • 全局安装
1
npm install [package name] -g
  • 局部安装 dependencies
1
npm install [package name] --save
  • 局部安装 devDependencies
1
npm install [package name] --save-dev
  • 指定安装最新版本
1
npm install [package name]@latest --save
  • 指定安装版本
1
npm install [package name]@1.0.0 --save
  • 指定安装大于等于@1.0.0 小于 2.2.0 版本
1
npm install [package name]@">=2.0.0 <1.0.0" --save
  • 删除全局包
1
npm uninstall  [package name] -g
  • 删除局部包
1
npm uninstall  [package name]
  • 列出本地全部可更新包
  • 升级全部包