• 《npm火速上手 - 表严肃讲npm》 - https://www.bilibili.com/video/av13816480


# 1. 安装 node.js

node.js 自带了 npm


# 2.更新最新版本

npm - 最基本 入门

npm - 最基本 入门

done


# 3. 使用

到项目【工作】目录

初始化
npm - 最基本 入门

  • -y 一路 yes

然后多了个 json 文件

安装jquery

npm i jquery

  • i 下载

后续 更换环境
只需要 npm i 之前的依赖就都回来了~

npm - 最基本 入门

删除

npm uninstall jquery

老版本 npm 需要 --save 如:npm uninstall jquery --save

更新
npm update jquery

指定版本
npm i [email protected]


# 4. 配置

scripts

.json 里面的 scripts 为可执行命令
npm - 最基本 入门
如:npm run test

npm - 最基本 入门

指定开发时依赖
添加: --save-dev

例如:
npm i webpack --save-dev

npm - 最基本 入门

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2021-11-28
  • 2021-07-17
  • 2021-10-11
  • 2021-09-23
猜你喜欢
  • 2021-08-19
  • 2021-06-17
  • 2021-05-15
  • 2022-12-23
  • 2021-06-06
  • 2021-11-14
  • 2022-01-03
相关资源
相似解决方案