Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh0ami-hy committed Sep 9, 2024
1 parent 1b639af commit a13f70a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
18 changes: 11 additions & 7 deletions _posts/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"state": {
"type": "markdown",
"state": {
"file": "2024-08-30-React最佳实践.md",
"file": "2023-12-30-node.md",
"mode": "source",
"source": false
}
Expand Down Expand Up @@ -65,11 +65,13 @@
"state": {}
}
}
]
],
"currentTab": 1
}
],
"direction": "horizontal",
"width": 300
"width": 300,
"collapsed": true
},
"right": {
"id": "d508948902057409",
Expand All @@ -85,7 +87,7 @@
"state": {
"type": "backlink",
"state": {
"file": "2024-08-30-React最佳实践.md",
"file": "2023-12-30-node.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -102,7 +104,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "2024-08-30-React最佳实践.md",
"file": "2023-12-30-node.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand Down Expand Up @@ -137,7 +139,7 @@
"state": {
"type": "outline",
"state": {
"file": "2024-08-30-React最佳实践.md"
"file": "2023-12-30-node.md"
}
}
}
Expand All @@ -158,10 +160,12 @@
"command-palette:Open command palette": false
}
},
"active": "14da16911b35c692",
"active": "484e8eca18f08b6b",
"lastOpenFiles": [
"2024-09-09-前端框架中的状态管理.md",
"2024-08-30-React最佳实践.md",
"2024-02-07-Vue项目结构.md",
"2024-03-24-Quasar开发总结.md",
"2024-08-26-React入门.md",
"2024-09-09-什么是状态.tx",
"新建文本文档.txt",
Expand Down
16 changes: 14 additions & 2 deletions _posts/2023-12-30-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,20 @@ pnpm config set cache-dir "D:\pnpm\cache" # pnpm全局缓存路径

# 7. 包管理器辨别

- `npm`是一个包管理器,方便开发者分享和下载开源包。经历了许多重大版本的更新,各方面已经和`yar`n在同一水平
- `npm`是一个包管理器,方便开发者分享和下载开源包。经历了许多重大版本的更新,各方面已经和`yarn`在同一水平
- `npx``[email protected]`的产物,`npx`会把下载的文件放在临时文件中,过一段时间会自动清除,但不会**立即**清除。
- `cnpm`是方便中国开发者下载依赖包而诞生的下载器。
- `yarn`解决了`npm@5`之前的一些让人诟病的问题,同时拥有一些其它的优点。例如离线安装、失败自动重试安装和并行下载等。
- `pnpm`通过连接的方式,让多个项目的依赖公用同一个包,大大节省了磁盘空间,比`yarn``npm`下载速度快得多,但是也有连接带来的各种兼容问题。
- `pnpm`通过连接的方式,让多个项目的依赖公用同一个包,大大节省了磁盘空间,比`yarn``npm`下载速度快得多,但是也有连接带来的各种兼容问题。

# 8. npm 使用

**npm安装依赖**
npm install xxx 利用 npm 安装xxx依赖到当前命令行所在目录
npm install xxx -g 利用npm安装全局依赖xxx
npm install xxx –save 安装并写入package.json的”dependencies”中
npm install xxx –save-dev 安装并写入package.json的”devDependencies”中

**npm删除依赖**
npm uninstall xxx 删除xxx依赖
npm uninstall xxx -g 删除全局依赖xxx

0 comments on commit a13f70a

Please sign in to comment.