化身天使的博客

node

安装

下载 [https://nodejs.org/download/release/v19.9.0/]

配置

源管理

  • 查看当前源 npm config get registry
  • 持久换源 npm config set registry http://registry.npm.taobao.org/

配置

  • 查看配置 npm config list

项目

  • 初始化项目 npm init -y
  • 运行项目中的脚本 npm run [script-name]

包管理

查看

  • 搜索包 npm search [包名]

安装

  • 全局安装 npm install -g [包名]
  • 本地安装生产依赖 npm install -S [包名]
  • 本地安装开发依赖 npm install -D [包名]
  • 安装时指定源 npm --registry https://registry.npm.taobao.org install [包名]
  • 安装所有依赖 npm install

更新

  • npm update [包名]

卸载

  • npm rm [包名]
  • 全局卸载 npm rm -g [包名]
  • 生产依赖卸载 npm rm --save [包名]
  • 开发依赖卸载 npm rm --save-dev [包名]
posted @ 2023-07-29 11:44  化身天使  阅读(47)  评论(0)    收藏  举报