Skip to content

Commit a2cd14f

Browse files
niheavenr15ch13
authored andcommitted
yarn: Make global persist and fix global bin issue (#3206)
- Yarn's global folder can be set via `yarn config set global-folder` (yarnpkg/yarn#7056) and thus can be persisted. - ~~Since yarn's global bin creating procedure is still problematic (yarnpkg/yarn#6902, **fixed by yarnpkg/yarn#6954 The `.bin` folder in `global\node_modules` is a better path to add to env, and this can avoid the annoying problem when you install scoop in some place except `C:` (that the shims in global bin have wrong relative path pointer). - If you install yarn via `scoop install yarn`, the `Yarn` folder in `$env:LOCALAPPDATA` is useless, and when you uninstall `yarn`, the `.yarnrc` is unused, so the manifest add `uninstaller.script` to remove them when you uninstall. - For reconfiguration, please use `scoop update yarn -f` instead of `scoop reset yarn`. - Close #2969
1 parent d70cec0 commit a2cd14f

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

bucket/yarn.json

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
{
22
"homepage": "https://yarnpkg.com/",
3-
"description": "Dependency manager",
4-
"license": "BSD-2-Clause",
3+
"description": "Node.js dependency manager",
54
"version": "1.15.2",
6-
"suggest": {
7-
"Node.js": [
8-
"nodejs",
9-
"nodejs-lts"
10-
],
11-
"NVM": "nvm"
12-
},
5+
"license": "BSD-2-Clause",
136
"url": "https://yarnpkg.com/downloads/1.15.2/yarn-1.15.2.msi",
147
"hash": "e3b07031012c83367809da702db77a70a151f457b4e83e6cb4d70e9426625f67",
158
"persist": [
169
"cache",
17-
"bin",
18-
"mirror"
10+
"mirror",
11+
"global"
1912
],
2013
"post_install": [
2114
"yarn config set cache-folder \"$dir\\cache\"",
2215
"yarn config set yarn-offline-mirror \"$dir\\mirror\"",
23-
"yarn config set prefix \"$dir\""
16+
"yarn config set global-folder \"$dir\\global\""
2417
],
18+
"uninstaller": {
19+
"script": [
20+
"Remove-Item $env:LOCALAPPDATA\\Yarn -Recurse -Force",
21+
"Remove-Item $env:USERPROFILE\\.yarnrc -Force"
22+
]
23+
},
2524
"env_add_path": [
26-
"bin",
25+
"global\\node_modules\\.bin",
2726
"Yarn\\bin"
2827
],
2928
"checkver": {
@@ -32,5 +31,13 @@
3231
},
3332
"autoupdate": {
3433
"url": "https://yarnpkg.com/downloads/$version/yarn-$version.msi"
34+
},
35+
"suggest": {
36+
"Node.js": [
37+
"nodejs",
38+
"nodejs-lts",
39+
"nvm",
40+
"nvs"
41+
]
3542
}
3643
}

0 commit comments

Comments
 (0)