Skip to content

Commit

Permalink
增加pnpm 命令
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Jun 9, 2024
1 parent 7e900a2 commit d64fdaf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"simple-git": "^3.24.0",
"vuepress": "^1.9.10",
"vuepress-plugin-autometa": "^0.1.13",
"vuepress-plugin-code-copy": "^1.0.6",
"vuepress-plugin-go-top": "^1.0.4",
"vuepress-plugin-sitemap": "^2.3.1"
}
Expand Down
3 changes: 3 additions & 0 deletions text/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ module.exports = {
'@vuepress/active-header-links': {},
'@vuepress/back-to-top': {},
'@vuepress/nprogress': {},
'vuepress-plugin-code-copy': {
align: 'bottom',
},
// 'vuepress-plugin-nuggets-style-copy': {},
'@whyun/vuepress-plugin-pdf-export': {
puppeteerLaunchOptions: {
Expand Down
2 changes: 1 addition & 1 deletion text/.vuepress/styles/index.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.giscus {
max-width: 740px;
margin: 0 auto;
}
}
10 changes: 10 additions & 0 deletions text/04_node_npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ packages:
**代码 4.6.1**
pnpm 没有自己专有的 npm 仓库地址设置,而是借用了 npm 的仓库地址,所以你可以直接复用 **命令 4.2.3** 和 **代码 4.3.1** 两种方式来设置 pnpm 仓库地址。
如果想更改 pnpm 下载文件的存放位置,可以使用如下命令:
```
pnpm config set store-dir d:\.pnpm-store
```
**命令 4.6.1**
同时需要留意的是,pnpm 全局安装命令前必须得设置 `global-dir` 属性,否则会提示 global-dir 不存在,不让安装。具体设置命令如下:
```
pnpm config set global-dir D:\pnpm
```
**命令 4.6.2**
### 4.7 发布自己的包到 npmjs

刚才演示了这么命令都是安装别人的包,现在我们自己开发一个包。首先你要注册一个npmjs的账号(注册地址:https://www.npmjs.com/signup )。注册完成后,通过`npm adduser`命令来将注册的账号绑定到本地机器上,运行完改命令后会让你输入 npmjs 的注册账号和密码。
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8964,6 +8964,11 @@ vuepress-plugin-autometa@^0.1.13:
remove-markdown "0.3.0"
striptags "3.1.1"

vuepress-plugin-code-copy@^1.0.6:
version "1.0.6"
resolved "https://registry.npmmirror.com/vuepress-plugin-code-copy/-/vuepress-plugin-code-copy-1.0.6.tgz#6431dab764b48b5b203e4936d98b1943651ce4ad"
integrity sha512-FiqwMtlb4rEsOI56O6sSkekcd3SlESxbkR2IaTIQxsMOMoalKfW5R9WlR1Pjm10v6jmU661Ex8MR11k9IzrNUg==

vuepress-plugin-container@^2.0.2:
version "2.1.5"
resolved "https://registry.npmmirror.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz#37fff05662fedbd63ffd3a5463b2592c7a7f3133"
Expand Down

0 comments on commit d64fdaf

Please sign in to comment.