@fredlackey/devutils 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/README.md +32 -150
  2. package/package.json +5 -82
  3. package/bin/dev.js +0 -16
  4. package/files/README.md +0 -0
  5. package/files/claude/.claude/commands/setup-context.md +0 -3
  6. package/files/monorepos/_archive/README.md +0 -36
  7. package/files/monorepos/_legacy/README.md +0 -36
  8. package/files/monorepos/ai-docs/README.md +0 -33
  9. package/files/monorepos/apps/README.md +0 -24
  10. package/files/monorepos/docs/README.md +0 -40
  11. package/files/monorepos/packages/README.md +0 -25
  12. package/files/monorepos/research/README.md +0 -29
  13. package/files/monorepos/scripts/README.md +0 -24
  14. package/src/cli.js +0 -72
  15. package/src/commands/README.md +0 -41
  16. package/src/commands/configure.js +0 -199
  17. package/src/commands/identity.js +0 -1630
  18. package/src/commands/ignore.js +0 -247
  19. package/src/commands/install.js +0 -526
  20. package/src/commands/setup.js +0 -246
  21. package/src/commands/status.js +0 -223
  22. package/src/commands/update.js +0 -142
  23. package/src/commands/version.js +0 -100
  24. package/src/completion.js +0 -284
  25. package/src/constants.js +0 -45
  26. package/src/ignore/claude-code.txt +0 -10
  27. package/src/ignore/docker.txt +0 -18
  28. package/src/ignore/linux.txt +0 -23
  29. package/src/ignore/macos.txt +0 -36
  30. package/src/ignore/node.txt +0 -55
  31. package/src/ignore/terraform.txt +0 -37
  32. package/src/ignore/vscode.txt +0 -18
  33. package/src/ignore/windows.txt +0 -35
  34. package/src/index.js +0 -0
  35. package/src/installs/README.md +0 -399
  36. package/src/installs/adobe-creative-cloud.js +0 -546
  37. package/src/installs/adobe-creative-cloud.md +0 -605
  38. package/src/installs/appcleaner.js +0 -321
  39. package/src/installs/appcleaner.md +0 -699
  40. package/src/installs/apt-transport-https.js +0 -390
  41. package/src/installs/apt-transport-https.md +0 -678
  42. package/src/installs/atomicparsley.js +0 -642
  43. package/src/installs/atomicparsley.md +0 -795
  44. package/src/installs/aws-cli.js +0 -797
  45. package/src/installs/aws-cli.md +0 -727
  46. package/src/installs/balena-etcher.js +0 -710
  47. package/src/installs/balena-etcher.md +0 -761
  48. package/src/installs/bambu-studio.js +0 -1143
  49. package/src/installs/bambu-studio.md +0 -780
  50. package/src/installs/bash-completion.js +0 -575
  51. package/src/installs/bash-completion.md +0 -833
  52. package/src/installs/bash.js +0 -417
  53. package/src/installs/bash.md +0 -993
  54. package/src/installs/beyond-compare.js +0 -603
  55. package/src/installs/beyond-compare.md +0 -813
  56. package/src/installs/brave-browser.js +0 -968
  57. package/src/installs/brave-browser.md +0 -650
  58. package/src/installs/build-essential.js +0 -529
  59. package/src/installs/build-essential.md +0 -977
  60. package/src/installs/ca-certificates.js +0 -618
  61. package/src/installs/ca-certificates.md +0 -937
  62. package/src/installs/caffeine.js +0 -508
  63. package/src/installs/caffeine.md +0 -839
  64. package/src/installs/camtasia.js +0 -596
  65. package/src/installs/camtasia.md +0 -762
  66. package/src/installs/chatgpt.js +0 -476
  67. package/src/installs/chatgpt.md +0 -814
  68. package/src/installs/chocolatey.js +0 -456
  69. package/src/installs/chocolatey.md +0 -661
  70. package/src/installs/chrome-canary.js +0 -419
  71. package/src/installs/chrome-canary.md +0 -641
  72. package/src/installs/chromium.js +0 -667
  73. package/src/installs/chromium.md +0 -838
  74. package/src/installs/claude-code.js +0 -576
  75. package/src/installs/claude-code.md +0 -1173
  76. package/src/installs/cloudflare-warp.js +0 -900
  77. package/src/installs/cloudflare-warp.md +0 -1047
  78. package/src/installs/comet-browser.js +0 -588
  79. package/src/installs/comet-browser.md +0 -731
  80. package/src/installs/curl.js +0 -379
  81. package/src/installs/curl.md +0 -714
  82. package/src/installs/cursor.js +0 -579
  83. package/src/installs/cursor.md +0 -970
  84. package/src/installs/dbeaver.js +0 -924
  85. package/src/installs/dbeaver.md +0 -939
  86. package/src/installs/dbschema.js +0 -692
  87. package/src/installs/dbschema.md +0 -925
  88. package/src/installs/dependencies.md +0 -453
  89. package/src/installs/development-tools.js +0 -600
  90. package/src/installs/development-tools.md +0 -977
  91. package/src/installs/docker.js +0 -1029
  92. package/src/installs/docker.md +0 -1109
  93. package/src/installs/drawio.js +0 -1019
  94. package/src/installs/drawio.md +0 -795
  95. package/src/installs/elmedia-player.js +0 -347
  96. package/src/installs/elmedia-player.md +0 -556
  97. package/src/installs/ffmpeg.js +0 -889
  98. package/src/installs/ffmpeg.md +0 -852
  99. package/src/installs/file.js +0 -464
  100. package/src/installs/file.md +0 -987
  101. package/src/installs/gemini-cli.js +0 -811
  102. package/src/installs/gemini-cli.md +0 -1153
  103. package/src/installs/git.js +0 -400
  104. package/src/installs/git.md +0 -907
  105. package/src/installs/gitego.js +0 -949
  106. package/src/installs/gitego.md +0 -1172
  107. package/src/installs/go.js +0 -931
  108. package/src/installs/go.md +0 -958
  109. package/src/installs/google-antigravity.js +0 -913
  110. package/src/installs/google-antigravity.md +0 -1075
  111. package/src/installs/google-chrome.js +0 -833
  112. package/src/installs/google-chrome.md +0 -862
  113. package/src/installs/gpg.js +0 -480
  114. package/src/installs/gpg.md +0 -1056
  115. package/src/installs/homebrew.js +0 -1028
  116. package/src/installs/homebrew.md +0 -988
  117. package/src/installs/imageoptim.js +0 -968
  118. package/src/installs/imageoptim.md +0 -1119
  119. package/src/installs/installers.json +0 -4032
  120. package/src/installs/installers.json.tmp +0 -3953
  121. package/src/installs/jq.js +0 -400
  122. package/src/installs/jq.md +0 -809
  123. package/src/installs/keyboard-maestro.js +0 -719
  124. package/src/installs/keyboard-maestro.md +0 -825
  125. package/src/installs/kiro.js +0 -864
  126. package/src/installs/kiro.md +0 -1015
  127. package/src/installs/latex.js +0 -789
  128. package/src/installs/latex.md +0 -1095
  129. package/src/installs/lftp.js +0 -356
  130. package/src/installs/lftp.md +0 -907
  131. package/src/installs/lsb-release.js +0 -346
  132. package/src/installs/lsb-release.md +0 -814
  133. package/src/installs/messenger.js +0 -847
  134. package/src/installs/messenger.md +0 -900
  135. package/src/installs/microsoft-office.js +0 -568
  136. package/src/installs/microsoft-office.md +0 -760
  137. package/src/installs/microsoft-teams.js +0 -801
  138. package/src/installs/microsoft-teams.md +0 -886
  139. package/src/installs/moom.js +0 -326
  140. package/src/installs/moom.md +0 -570
  141. package/src/installs/node.js +0 -904
  142. package/src/installs/node.md +0 -1153
  143. package/src/installs/nordpass.js +0 -716
  144. package/src/installs/nordpass.md +0 -921
  145. package/src/installs/nordvpn.js +0 -892
  146. package/src/installs/nordvpn.md +0 -1052
  147. package/src/installs/nvm.js +0 -995
  148. package/src/installs/nvm.md +0 -1057
  149. package/src/installs/ohmyzsh.js +0 -529
  150. package/src/installs/ohmyzsh.md +0 -1094
  151. package/src/installs/openssh.js +0 -804
  152. package/src/installs/openssh.md +0 -1056
  153. package/src/installs/pandoc.js +0 -662
  154. package/src/installs/pandoc.md +0 -1036
  155. package/src/installs/parallels-desktop.js +0 -431
  156. package/src/installs/parallels-desktop.md +0 -446
  157. package/src/installs/pinentry.js +0 -510
  158. package/src/installs/pinentry.md +0 -1142
  159. package/src/installs/pngyu.js +0 -869
  160. package/src/installs/pngyu.md +0 -896
  161. package/src/installs/postman.js +0 -799
  162. package/src/installs/postman.md +0 -940
  163. package/src/installs/procps.js +0 -425
  164. package/src/installs/procps.md +0 -851
  165. package/src/installs/safari-tech-preview.js +0 -374
  166. package/src/installs/safari-tech-preview.md +0 -533
  167. package/src/installs/sfnt2woff.js +0 -658
  168. package/src/installs/sfnt2woff.md +0 -795
  169. package/src/installs/shellcheck.js +0 -481
  170. package/src/installs/shellcheck.md +0 -1005
  171. package/src/installs/slack.js +0 -741
  172. package/src/installs/slack.md +0 -865
  173. package/src/installs/snagit.js +0 -585
  174. package/src/installs/snagit.md +0 -844
  175. package/src/installs/software-properties-common.js +0 -372
  176. package/src/installs/software-properties-common.md +0 -805
  177. package/src/installs/spotify.js +0 -877
  178. package/src/installs/spotify.md +0 -901
  179. package/src/installs/studio-3t.js +0 -823
  180. package/src/installs/studio-3t.md +0 -918
  181. package/src/installs/sublime-text.js +0 -804
  182. package/src/installs/sublime-text.md +0 -914
  183. package/src/installs/superwhisper.js +0 -706
  184. package/src/installs/superwhisper.md +0 -630
  185. package/src/installs/tailscale.js +0 -745
  186. package/src/installs/tailscale.md +0 -1100
  187. package/src/installs/tar.js +0 -389
  188. package/src/installs/tar.md +0 -946
  189. package/src/installs/termius.js +0 -798
  190. package/src/installs/termius.md +0 -844
  191. package/src/installs/terraform.js +0 -779
  192. package/src/installs/terraform.md +0 -899
  193. package/src/installs/tfenv.js +0 -778
  194. package/src/installs/tfenv.md +0 -1091
  195. package/src/installs/tidal.js +0 -771
  196. package/src/installs/tidal.md +0 -864
  197. package/src/installs/tmux.js +0 -346
  198. package/src/installs/tmux.md +0 -1030
  199. package/src/installs/tree.js +0 -411
  200. package/src/installs/tree.md +0 -833
  201. package/src/installs/unzip.js +0 -460
  202. package/src/installs/unzip.md +0 -879
  203. package/src/installs/vim.js +0 -421
  204. package/src/installs/vim.md +0 -1040
  205. package/src/installs/vlc.js +0 -821
  206. package/src/installs/vlc.md +0 -927
  207. package/src/installs/vscode.js +0 -843
  208. package/src/installs/vscode.md +0 -1002
  209. package/src/installs/wget.js +0 -420
  210. package/src/installs/wget.md +0 -791
  211. package/src/installs/whatsapp.js +0 -729
  212. package/src/installs/whatsapp.md +0 -854
  213. package/src/installs/winpty.js +0 -352
  214. package/src/installs/winpty.md +0 -620
  215. package/src/installs/woff2.js +0 -553
  216. package/src/installs/woff2.md +0 -977
  217. package/src/installs/wsl.js +0 -572
  218. package/src/installs/wsl.md +0 -699
  219. package/src/installs/xcode-clt.js +0 -520
  220. package/src/installs/xcode-clt.md +0 -351
  221. package/src/installs/xcode.js +0 -560
  222. package/src/installs/xcode.md +0 -573
  223. package/src/installs/yarn.js +0 -824
  224. package/src/installs/yarn.md +0 -1074
  225. package/src/installs/yq.js +0 -654
  226. package/src/installs/yq.md +0 -944
  227. package/src/installs/yt-dlp.js +0 -701
  228. package/src/installs/yt-dlp.md +0 -946
  229. package/src/installs/yum-utils.js +0 -297
  230. package/src/installs/yum-utils.md +0 -648
  231. package/src/installs/zoom.js +0 -759
  232. package/src/installs/zoom.md +0 -884
  233. package/src/installs/zsh.js +0 -455
  234. package/src/installs/zsh.md +0 -1008
  235. package/src/scripts/README.md +0 -617
  236. package/src/scripts/STATUS.md +0 -208
  237. package/src/scripts/afk.js +0 -411
  238. package/src/scripts/backup-all.js +0 -746
  239. package/src/scripts/backup-source.js +0 -727
  240. package/src/scripts/brewd.js +0 -389
  241. package/src/scripts/brewi.js +0 -520
  242. package/src/scripts/brewr.js +0 -527
  243. package/src/scripts/brews.js +0 -477
  244. package/src/scripts/brewu.js +0 -504
  245. package/src/scripts/c.js +0 -201
  246. package/src/scripts/ccurl.js +0 -341
  247. package/src/scripts/certbot-crontab-init.js +0 -504
  248. package/src/scripts/certbot-init.js +0 -657
  249. package/src/scripts/ch.js +0 -355
  250. package/src/scripts/claude-danger.js +0 -268
  251. package/src/scripts/clean-dev.js +0 -435
  252. package/src/scripts/clear-dns-cache.js +0 -541
  253. package/src/scripts/clone.js +0 -435
  254. package/src/scripts/code-all.js +0 -437
  255. package/src/scripts/count-files.js +0 -211
  256. package/src/scripts/count-folders.js +0 -211
  257. package/src/scripts/count.js +0 -264
  258. package/src/scripts/d.js +0 -219
  259. package/src/scripts/datauri.js +0 -389
  260. package/src/scripts/delete-files.js +0 -380
  261. package/src/scripts/docker-clean.js +0 -426
  262. package/src/scripts/dp.js +0 -442
  263. package/src/scripts/e.js +0 -390
  264. package/src/scripts/empty-trash.js +0 -513
  265. package/src/scripts/evm.js +0 -444
  266. package/src/scripts/fetch-github-repos.js +0 -456
  267. package/src/scripts/get-channel.js +0 -345
  268. package/src/scripts/get-course.js +0 -399
  269. package/src/scripts/get-dependencies.js +0 -306
  270. package/src/scripts/get-folder.js +0 -799
  271. package/src/scripts/get-tunes.js +0 -426
  272. package/src/scripts/get-video.js +0 -367
  273. package/src/scripts/git-backup.js +0 -577
  274. package/src/scripts/git-clone.js +0 -493
  275. package/src/scripts/git-pup.js +0 -319
  276. package/src/scripts/git-push.js +0 -396
  277. package/src/scripts/h.js +0 -622
  278. package/src/scripts/hide-desktop-icons.js +0 -499
  279. package/src/scripts/hide-hidden-files.js +0 -538
  280. package/src/scripts/install-dependencies-from.js +0 -456
  281. package/src/scripts/ips.js +0 -663
  282. package/src/scripts/iso.js +0 -370
  283. package/src/scripts/killni.js +0 -577
  284. package/src/scripts/ll.js +0 -467
  285. package/src/scripts/local-ip.js +0 -325
  286. package/src/scripts/m.js +0 -524
  287. package/src/scripts/map.js +0 -309
  288. package/src/scripts/mkd.js +0 -351
  289. package/src/scripts/ncu-update-all.js +0 -457
  290. package/src/scripts/nginx-init.js +0 -718
  291. package/src/scripts/npmi.js +0 -382
  292. package/src/scripts/o.js +0 -511
  293. package/src/scripts/org-by-date.js +0 -338
  294. package/src/scripts/p.js +0 -224
  295. package/src/scripts/packages.js +0 -330
  296. package/src/scripts/path.js +0 -225
  297. package/src/scripts/ports.js +0 -597
  298. package/src/scripts/q.js +0 -305
  299. package/src/scripts/refresh-files.js +0 -394
  300. package/src/scripts/remove-smaller-files.js +0 -516
  301. package/src/scripts/rename-files-with-date.js +0 -533
  302. package/src/scripts/resize-image.js +0 -539
  303. package/src/scripts/rm-safe.js +0 -669
  304. package/src/scripts/s.js +0 -540
  305. package/src/scripts/set-git-public.js +0 -365
  306. package/src/scripts/show-desktop-icons.js +0 -475
  307. package/src/scripts/show-hidden-files.js +0 -472
  308. package/src/scripts/tpa.js +0 -280
  309. package/src/scripts/tpo.js +0 -280
  310. package/src/scripts/u.js +0 -505
  311. package/src/scripts/vpush.js +0 -437
  312. package/src/scripts/y.js +0 -283
  313. package/src/utils/README.md +0 -95
  314. package/src/utils/common/apps.js +0 -143
  315. package/src/utils/common/display.js +0 -157
  316. package/src/utils/common/network.js +0 -185
  317. package/src/utils/common/os.js +0 -294
  318. package/src/utils/common/package-manager.js +0 -301
  319. package/src/utils/common/privileges.js +0 -138
  320. package/src/utils/common/shell.js +0 -261
  321. package/src/utils/macos/apps.js +0 -228
  322. package/src/utils/macos/brew.js +0 -315
  323. package/src/utils/ubuntu/apt.js +0 -307
  324. package/src/utils/ubuntu/desktop.js +0 -292
  325. package/src/utils/ubuntu/snap.js +0 -344
  326. package/src/utils/ubuntu/systemd.js +0 -286
  327. package/src/utils/windows/choco.js +0 -465
  328. package/src/utils/windows/env.js +0 -246
  329. package/src/utils/windows/registry.js +0 -269
  330. package/src/utils/windows/shell.js +0 -240
  331. package/src/utils/windows/winget.js +0 -489
@@ -1,1074 +0,0 @@
1
- # Installing Yarn
2
-
3
- ## Overview
4
-
5
- Yarn is a fast, reliable, and secure JavaScript package manager developed by Facebook (now Meta) as an alternative to npm. It addresses key pain points in JavaScript dependency management by offering deterministic installations, offline caching, and parallel downloads. Yarn provides two major version lines:
6
-
7
- - **Yarn Classic (1.x)**: The original, stable version still widely used in production environments. This is what system package managers (Homebrew, APT, Chocolatey) install by default.
8
- - **Yarn Modern (Berry, 2.x+)**: A complete rewrite with advanced features like Plug'n'Play (zero `node_modules`), workspaces, and plugins. Managed per-project via Corepack or `yarn set version`.
9
-
10
- Key capabilities of Yarn:
11
-
12
- - Deterministic dependency resolution through lockfiles
13
- - Parallel package downloads for faster installations
14
- - Offline mode using cached packages
15
- - Workspaces for monorepo management
16
- - Security-focused design with integrity checks
17
-
18
- This guide documents Yarn Classic (1.x) installation for system-wide availability across all platforms supported by DevUtils CLI. For projects requiring Yarn Modern (2.x+), use Corepack after installing Node.js.
19
-
20
- ## Prerequisites
21
-
22
- Before installing Yarn on any platform, ensure:
23
-
24
- 1. **Node.js installed** - Yarn requires Node.js 18 or later (LTS recommended)
25
- 2. **Internet connectivity** - Required to download Yarn packages
26
- 3. **Administrative privileges** - Required for system-wide installation
27
- 4. **Terminal access** - Required to run installation commands
28
-
29
- **Version Strategy**: This guide installs Yarn Classic (1.x) for maximum compatibility. If your project requires Yarn Modern (2.x, 3.x, or 4.x), install Node.js first, then use Corepack:
30
-
31
- ```bash
32
- corepack enable
33
- yarn init -2
34
- ```
35
-
36
- ## Dependencies
37
-
38
- ### macOS (Homebrew)
39
- - **Required:**
40
- - Homebrew - Install via `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` or `dev install homebrew`
41
- - **Optional:** None
42
- - **Auto-installed:**
43
- - Node.js - Homebrew automatically installs Node.js as a dependency if not present
44
-
45
- ### Ubuntu (APT/Snap)
46
- - **Required:**
47
- - `curl` - Install via `sudo apt-get install -y curl`
48
- - `gnupg` - Install via `sudo apt-get install -y gnupg`
49
- - `ca-certificates` - Install via `sudo apt-get install -y ca-certificates`
50
- - **Optional:**
51
- - Node.js - Install via `dev install node` or NodeSource repository (recommended but not enforced by installer)
52
- - **Auto-installed:**
53
- - None (all dependencies must be explicitly installed)
54
- - **Note:** The conflicting `cmdtest` package is automatically removed if present
55
-
56
- ### Raspberry Pi OS (APT/Snap)
57
- - **Required:**
58
- - `curl` - Install via `sudo apt-get install -y curl`
59
- - `gnupg` - Install via `sudo apt-get install -y gnupg`
60
- - `ca-certificates` - Install via `sudo apt-get install -y ca-certificates`
61
- - **Optional:**
62
- - Node.js - Install via `dev install node` or NodeSource repository (recommended but not enforced by installer)
63
- - **Auto-installed:**
64
- - None (all dependencies must be explicitly installed)
65
- - **Note:** The conflicting `cmdtest` package is automatically removed if present
66
-
67
- ### Amazon Linux (DNF/YUM)
68
- - **Required:**
69
- - `curl` - Install via `sudo dnf install -y curl` (AL2023) or `sudo yum install -y curl` (AL2)
70
- - DNF or YUM package manager - Pre-installed on Amazon Linux, RHEL, Fedora, CentOS
71
- - **Optional:**
72
- - Node.js - Install via `dev install node` (recommended but not enforced by installer)
73
- - **Auto-installed:**
74
- - None (all dependencies must be explicitly installed)
75
-
76
- ### Windows (Chocolatey/winget)
77
- - **Required:**
78
- - Chocolatey - Install via PowerShell: `Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))`
79
- - Administrator privileges - Required for Chocolatey package installation
80
- - **Optional:**
81
- - Node.js - Install via `choco install nodejs-lts -y` (recommended but Chocolatey can install it automatically as a dependency)
82
- - **Auto-installed:**
83
- - Node.js - Chocolatey can automatically install Node.js as a dependency if missing
84
-
85
- ### Git Bash (Manual/Portable)
86
- - **Required:**
87
- - Git Bash (Git for Windows) - Download from https://git-scm.com/download/win
88
- - Chocolatey on Windows host - Install via PowerShell (see Windows section above)
89
- - Administrator privileges - Required for Chocolatey operations via PowerShell interop
90
- - **Optional:**
91
- - `winpty` - Install via `pacman -S winpty` in Git Bash (for interactive Yarn commands, usually pre-installed with Git for Windows)
92
- - Node.js - Install via `choco install nodejs-lts -y` (recommended)
93
- - **Auto-installed:**
94
- - Node.js - Chocolatey can automatically install Node.js as a dependency if missing
95
- - **Note:** Yarn is installed on the Windows host and becomes available in Git Bash through PATH inheritance
96
-
97
- ## Platform-Specific Installation
98
-
99
- ### macOS (Homebrew)
100
-
101
- #### Prerequisites
102
-
103
- - macOS 12 (Monterey) or later (macOS 14 Sonoma or later recommended)
104
- - Homebrew package manager installed
105
- - Node.js installed (Homebrew will install it as a dependency if missing)
106
- - Apple Silicon (M1/M2/M3/M4) or Intel processor
107
-
108
- If Homebrew is not installed, install it first:
109
-
110
- ```bash
111
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
112
- ```
113
-
114
- If Node.js is not installed, install it first:
115
-
116
- ```bash
117
- brew install --quiet node
118
- ```
119
-
120
- #### Installation Steps
121
-
122
- Run the following command to install Yarn:
123
-
124
- ```bash
125
- brew install --quiet yarn
126
- ```
127
-
128
- The `--quiet` flag suppresses non-essential output, making the installation suitable for automation and scripts. This installs Yarn Classic (1.22.x), which is the stable version provided by Homebrew.
129
-
130
- **Note**: The Homebrew `yarn` formula conflicts with `corepack` and `hadoop` packages. If you have either installed, you must uninstall them first or use npm to install Yarn instead.
131
-
132
- #### Verification
133
-
134
- Confirm the installation succeeded:
135
-
136
- ```bash
137
- yarn --version
138
- ```
139
-
140
- Expected output (version numbers may vary):
141
-
142
- ```
143
- 1.22.22
144
- ```
145
-
146
- Verify the Homebrew version is being used:
147
-
148
- ```bash
149
- which yarn
150
- ```
151
-
152
- Expected output for Apple Silicon Macs:
153
-
154
- ```
155
- /opt/homebrew/bin/yarn
156
- ```
157
-
158
- Expected output for Intel Macs:
159
-
160
- ```
161
- /usr/local/bin/yarn
162
- ```
163
-
164
- Test Yarn works by checking its configuration:
165
-
166
- ```bash
167
- yarn config list
168
- ```
169
-
170
- #### Troubleshooting
171
-
172
- **Problem**: `brew: command not found`
173
-
174
- **Solution**: Homebrew is not installed or not in PATH. Install Homebrew first:
175
-
176
- ```bash
177
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
178
- ```
179
-
180
- **Problem**: Conflict with corepack
181
-
182
- **Solution**: If you see a conflict error, you must choose between Homebrew's Yarn or Corepack-managed Yarn:
183
-
184
- ```bash
185
- # Option: Remove Homebrew yarn and use corepack
186
- brew uninstall yarn
187
- corepack enable
188
- ```
189
-
190
- **Problem**: `yarn --version` shows unexpected version or command not found
191
-
192
- **Solution**: Ensure Homebrew's bin directory is in your PATH before other directories:
193
-
194
- ```bash
195
- echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
196
- source ~/.zshrc
197
- ```
198
-
199
- For Intel Macs, use `/usr/local/bin` instead of `/opt/homebrew/bin`.
200
-
201
- **Problem**: Yarn cannot find Node.js
202
-
203
- **Solution**: Ensure Node.js is installed via Homebrew:
204
-
205
- ```bash
206
- brew install --quiet node
207
- ```
208
-
209
- ---
210
-
211
- ### Ubuntu/Debian (APT)
212
-
213
- #### Prerequisites
214
-
215
- - Ubuntu 20.04 LTS or later, or Debian 11 (Bullseye) or later (64-bit)
216
- - sudo privileges
217
- - Node.js installed (install via NodeSource repository for latest versions)
218
- - curl and gnupg installed
219
-
220
- **Important**: Some older Ubuntu versions ship with a package called `cmdtest` that provides a different `yarn` command. Remove it first to avoid conflicts.
221
-
222
- #### Installation Steps
223
-
224
- **Step 1: Remove conflicting packages**
225
-
226
- ```bash
227
- sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y cmdtest 2>/dev/null || true
228
- ```
229
-
230
- **Step 2: Install prerequisites**
231
-
232
- ```bash
233
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
234
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg ca-certificates
235
- ```
236
-
237
- **Step 3: Add the Yarn GPG key and repository**
238
-
239
- ```bash
240
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/yarn-archive-keyring.gpg > /dev/null
241
- echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
242
- ```
243
-
244
- **Step 4: Install Yarn**
245
-
246
- ```bash
247
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
248
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y yarn
249
- ```
250
-
251
- The `DEBIAN_FRONTEND=noninteractive` environment variable ensures no interactive prompts appear during installation, making this suitable for scripts and automation.
252
-
253
- **Note for nvm users**: If you manage Node.js with nvm, install Yarn without the Node.js dependency:
254
-
255
- ```bash
256
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends yarn
257
- ```
258
-
259
- #### Verification
260
-
261
- Confirm the installation succeeded:
262
-
263
- ```bash
264
- yarn --version
265
- ```
266
-
267
- Expected output (version numbers may vary):
268
-
269
- ```
270
- 1.22.22
271
- ```
272
-
273
- Verify the installation location:
274
-
275
- ```bash
276
- which yarn
277
- ```
278
-
279
- Expected output:
280
-
281
- ```
282
- /usr/bin/yarn
283
- ```
284
-
285
- Test Yarn works by checking its configuration:
286
-
287
- ```bash
288
- yarn config list
289
- ```
290
-
291
- #### Troubleshooting
292
-
293
- **Problem**: `E: Unable to locate package yarn`
294
-
295
- **Solution**: The Yarn repository was not added correctly. Re-run the repository setup:
296
-
297
- ```bash
298
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/yarn-archive-keyring.gpg > /dev/null
299
- echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
300
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
301
- ```
302
-
303
- **Problem**: Running `yarn` opens a different program (cmdtest)
304
-
305
- **Solution**: The `cmdtest` package provides a conflicting `yarn` command. Remove it:
306
-
307
- ```bash
308
- sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y cmdtest
309
- hash -r
310
- ```
311
-
312
- **Problem**: GPG key errors during repository setup
313
-
314
- **Solution**: Ensure gnupg and ca-certificates are installed:
315
-
316
- ```bash
317
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gnupg ca-certificates
318
- ```
319
-
320
- **Problem**: Yarn cannot find Node.js
321
-
322
- **Solution**: Install Node.js via the NodeSource repository:
323
-
324
- ```bash
325
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
326
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
327
- ```
328
-
329
- ---
330
-
331
- ### Raspberry Pi OS (APT)
332
-
333
- #### Prerequisites
334
-
335
- - Raspberry Pi OS (Bookworm or Bullseye recommended)
336
- - Raspberry Pi 3B+ or later (64-bit OS recommended)
337
- - At least 1 GB RAM (2 GB or more recommended)
338
- - sudo privileges
339
- - Node.js installed
340
- - Internet connectivity
341
-
342
- **Architecture Note**: Raspberry Pi OS supports both 32-bit (armhf/armv7l) and 64-bit (arm64/aarch64) versions. Yarn works on both architectures.
343
-
344
- First, verify your architecture:
345
-
346
- ```bash
347
- uname -m
348
- ```
349
-
350
- - `aarch64` = 64-bit ARM (recommended)
351
- - `armv7l` = 32-bit ARM
352
-
353
- #### Installation Steps
354
-
355
- The installation process is identical to Ubuntu/Debian since Raspberry Pi OS is Debian-based.
356
-
357
- **Step 1: Remove conflicting packages**
358
-
359
- ```bash
360
- sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y cmdtest 2>/dev/null || true
361
- ```
362
-
363
- **Step 2: Install prerequisites**
364
-
365
- ```bash
366
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
367
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg ca-certificates
368
- ```
369
-
370
- **Step 3: Add the Yarn GPG key and repository**
371
-
372
- ```bash
373
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/yarn-archive-keyring.gpg > /dev/null
374
- echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
375
- ```
376
-
377
- **Step 4: Install Yarn**
378
-
379
- ```bash
380
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
381
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y yarn
382
- ```
383
-
384
- #### Verification
385
-
386
- Confirm the installation succeeded:
387
-
388
- ```bash
389
- yarn --version
390
- ```
391
-
392
- Expected output (version numbers may vary):
393
-
394
- ```
395
- 1.22.22
396
- ```
397
-
398
- Test Yarn works with your architecture:
399
-
400
- ```bash
401
- yarn config list
402
- node -e "console.log('Yarn is working on ' + process.arch)"
403
- ```
404
-
405
- Expected output:
406
-
407
- ```
408
- Yarn is working on arm64
409
- ```
410
-
411
- (or `arm` for 32-bit systems)
412
-
413
- #### Troubleshooting
414
-
415
- **Problem**: Installation is very slow
416
-
417
- **Solution**: Raspberry Pi SD cards can be slow. Use a high-quality SD card (Class 10, A1/A2 rated) or boot from USB/SSD for better performance.
418
-
419
- **Problem**: `yarn install` fails with out of memory errors
420
-
421
- **Solution**: Raspberry Pi has limited RAM. Increase swap space:
422
-
423
- ```bash
424
- sudo fallocate -l 2G /swapfile
425
- sudo chmod 600 /swapfile
426
- sudo mkswap /swapfile
427
- sudo swapon /swapfile
428
- echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
429
- ```
430
-
431
- **Problem**: Yarn cannot find Node.js on ARMv6 (Pi Zero/Pi 1)
432
-
433
- **Solution**: ARMv6 requires unofficial Node.js builds. See the Node.js documentation for ARMv6 installation, then install Yarn via npm:
434
-
435
- ```bash
436
- npm install -g yarn
437
- ```
438
-
439
- ---
440
-
441
- ### Amazon Linux/RHEL (YUM/DNF)
442
-
443
- #### Prerequisites
444
-
445
- - Amazon Linux 2023 (AL2023) or Amazon Linux 2 (AL2)
446
- - Alternatively: RHEL 8+, CentOS Stream 8+, Fedora 36+
447
- - sudo privileges
448
- - Node.js installed
449
- - Internet connectivity
450
-
451
- **Note**: Amazon Linux 2023 uses DNF as the package manager. Amazon Linux 2 uses YUM. The commands below work with both.
452
-
453
- #### Installation Steps
454
-
455
- **Step 1: Import the Yarn GPG key**
456
-
457
- ```bash
458
- sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
459
- ```
460
-
461
- **Step 2: Add the Yarn repository**
462
-
463
- ```bash
464
- sudo curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
465
- ```
466
-
467
- **Step 3: Install Yarn**
468
-
469
- For Amazon Linux 2023 / RHEL 8+ / Fedora (DNF):
470
-
471
- ```bash
472
- sudo dnf install -y yarn
473
- ```
474
-
475
- For Amazon Linux 2 / RHEL 7 / CentOS 7 (YUM):
476
-
477
- ```bash
478
- sudo yum install -y yarn
479
- ```
480
-
481
- The `-y` flag automatically confirms the installation, making this suitable for scripts and automation.
482
-
483
- #### Verification
484
-
485
- Confirm the installation succeeded:
486
-
487
- ```bash
488
- yarn --version
489
- ```
490
-
491
- Expected output (version numbers may vary):
492
-
493
- ```
494
- 1.22.22
495
- ```
496
-
497
- Verify the installation location:
498
-
499
- ```bash
500
- which yarn
501
- ```
502
-
503
- Expected output:
504
-
505
- ```
506
- /usr/bin/yarn
507
- ```
508
-
509
- Test Yarn works:
510
-
511
- ```bash
512
- yarn config list
513
- ```
514
-
515
- #### Troubleshooting
516
-
517
- **Problem**: `No package yarn available`
518
-
519
- **Solution**: The Yarn repository was not added correctly. Verify the repo file exists:
520
-
521
- ```bash
522
- cat /etc/yum.repos.d/yarn.repo
523
- ```
524
-
525
- If empty or missing, re-run the repository setup:
526
-
527
- ```bash
528
- sudo curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
529
- sudo dnf clean all # or: sudo yum clean all
530
- ```
531
-
532
- **Problem**: GPG key verification fails
533
-
534
- **Solution**: Import the GPG key:
535
-
536
- ```bash
537
- sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
538
- ```
539
-
540
- **Problem**: Yarn cannot find Node.js
541
-
542
- **Solution**: Install Node.js first. For Amazon Linux 2023:
543
-
544
- ```bash
545
- sudo dnf install -y nodejs22 nodejs22-npm
546
- sudo alternatives --set node /usr/bin/node-22
547
- ```
548
-
549
- For Amazon Linux 2:
550
-
551
- ```bash
552
- curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
553
- sudo yum install -y nodejs
554
- ```
555
-
556
- ---
557
-
558
- ### Windows (Chocolatey)
559
-
560
- #### Prerequisites
561
-
562
- - Windows 10 version 1903 or higher (64-bit), or Windows 11
563
- - Administrator PowerShell or Command Prompt
564
- - Chocolatey package manager installed
565
- - Node.js installed (Chocolatey can install it automatically)
566
- - Internet connectivity
567
-
568
- If Chocolatey is not installed, install it first by running this command in an Administrator PowerShell:
569
-
570
- ```powershell
571
- Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
572
- ```
573
-
574
- If Node.js is not installed, install it first:
575
-
576
- ```powershell
577
- choco install nodejs-lts -y
578
- ```
579
-
580
- #### Installation Steps
581
-
582
- Run the following command in an Administrator PowerShell or Command Prompt:
583
-
584
- ```powershell
585
- choco install yarn -y
586
- ```
587
-
588
- The `-y` flag automatically confirms all prompts, enabling fully non-interactive installation suitable for automation and scripts. This installs Yarn Classic (1.22.x).
589
-
590
- After installation, close and reopen your terminal to ensure PATH changes take effect.
591
-
592
- #### Verification
593
-
594
- Open a new Command Prompt or PowerShell window, then run:
595
-
596
- ```powershell
597
- yarn --version
598
- ```
599
-
600
- Expected output (version numbers may vary):
601
-
602
- ```
603
- 1.22.22
604
- ```
605
-
606
- Verify the installation location:
607
-
608
- ```powershell
609
- where yarn
610
- ```
611
-
612
- Expected output:
613
-
614
- ```
615
- C:\Program Files (x86)\Yarn\bin\yarn
616
- C:\Program Files (x86)\Yarn\bin\yarn.cmd
617
- ```
618
-
619
- Test Yarn works:
620
-
621
- ```powershell
622
- yarn config list
623
- ```
624
-
625
- #### Troubleshooting
626
-
627
- **Problem**: `'yarn' is not recognized as an internal or external command`
628
-
629
- **Solution**: Close and reopen your terminal window. If the problem persists, verify Yarn is in your PATH:
630
-
631
- ```powershell
632
- $env:PATH -split ';' | Select-String -Pattern 'Yarn'
633
- ```
634
-
635
- If not listed, add it manually or reinstall:
636
-
637
- ```powershell
638
- choco uninstall yarn -y
639
- choco install yarn -y
640
- ```
641
-
642
- **Problem**: Chocolatey installation fails
643
-
644
- **Solution**: Ensure you are running PowerShell as Administrator. Right-click PowerShell and select "Run as administrator".
645
-
646
- **Problem**: Node.js not found
647
-
648
- **Solution**: Install Node.js before Yarn:
649
-
650
- ```powershell
651
- choco install nodejs-lts -y
652
- ```
653
-
654
- Close and reopen your terminal, then install Yarn.
655
-
656
- **Problem**: SSL/TLS errors during installation
657
-
658
- **Solution**: Update your security protocols before installing:
659
-
660
- ```powershell
661
- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
662
- choco install yarn -y
663
- ```
664
-
665
- ---
666
-
667
- ### WSL (Ubuntu)
668
-
669
- #### Prerequisites
670
-
671
- - Windows 10 version 2004 or higher, or Windows 11
672
- - WSL 2 enabled with Ubuntu distribution installed
673
- - sudo privileges within WSL
674
- - Node.js installed within WSL
675
- - Internet connectivity
676
-
677
- WSL runs Ubuntu (or another Linux distribution) within Windows. Yarn must be installed separately within WSL, as it does not share binaries with Windows.
678
-
679
- #### Installation Steps
680
-
681
- Open your WSL Ubuntu terminal and run:
682
-
683
- **Step 1: Remove conflicting packages**
684
-
685
- ```bash
686
- sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y cmdtest 2>/dev/null || true
687
- ```
688
-
689
- **Step 2: Install prerequisites**
690
-
691
- ```bash
692
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
693
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg ca-certificates
694
- ```
695
-
696
- **Step 3: Add the Yarn GPG key and repository**
697
-
698
- ```bash
699
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/keyrings/yarn-archive-keyring.gpg > /dev/null
700
- echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
701
- ```
702
-
703
- **Step 4: Install Yarn**
704
-
705
- ```bash
706
- sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
707
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y yarn
708
- ```
709
-
710
- #### Verification
711
-
712
- Confirm the installation succeeded:
713
-
714
- ```bash
715
- yarn --version
716
- ```
717
-
718
- Expected output (version numbers may vary):
719
-
720
- ```
721
- 1.22.22
722
- ```
723
-
724
- Verify the installation location:
725
-
726
- ```bash
727
- which yarn
728
- ```
729
-
730
- Expected output:
731
-
732
- ```
733
- /usr/bin/yarn
734
- ```
735
-
736
- #### Troubleshooting
737
-
738
- **Problem**: Yarn version differs between WSL and Windows
739
-
740
- **Solution**: This is expected behavior. WSL and Windows maintain separate Yarn installations. Use the appropriate installation for each environment:
741
-
742
- - Inside WSL terminal: Use Linux Yarn (`/usr/bin/yarn`)
743
- - In Windows PowerShell/CMD: Use Windows Yarn (`C:\Program Files (x86)\Yarn\bin\yarn`)
744
-
745
- **Problem**: `yarn install` is slow or times out
746
-
747
- **Solution**: WSL file system performance is better on the Linux filesystem. Store your projects in the WSL home directory (`~/projects`) rather than Windows mounts (`/mnt/c/...`):
748
-
749
- ```bash
750
- mkdir -p ~/projects
751
- cd ~/projects
752
- ```
753
-
754
- **Problem**: Node.js not found
755
-
756
- **Solution**: Install Node.js in WSL using the NodeSource repository:
757
-
758
- ```bash
759
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
760
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
761
- ```
762
-
763
- ---
764
-
765
- ### Git Bash (Windows Installation)
766
-
767
- #### Prerequisites
768
-
769
- - Windows 10 or Windows 11 (64-bit)
770
- - Git Bash installed (comes with Git for Windows)
771
- - Administrator access for installation
772
- - Node.js and Yarn installed on Windows
773
- - Internet connectivity
774
-
775
- **Note**: Git Bash on Windows does not require a separate Yarn installation. Git Bash inherits the Windows PATH, so once Yarn is installed on Windows, the `yarn` command is automatically available in Git Bash.
776
-
777
- #### Installation Steps
778
-
779
- **Step 1: Install Yarn on Windows using Chocolatey**
780
-
781
- Run the following command in an Administrator PowerShell or Command Prompt:
782
-
783
- ```powershell
784
- choco install yarn -y
785
- ```
786
-
787
- **Step 2: Close and reopen Git Bash**
788
-
789
- After installation, close any open Git Bash windows and open a new one to pick up the updated PATH.
790
-
791
- **Step 3: Verify Yarn is accessible**
792
-
793
- In Git Bash:
794
-
795
- ```bash
796
- yarn --version
797
- ```
798
-
799
- #### Verification
800
-
801
- In Git Bash, confirm Yarn is accessible:
802
-
803
- ```bash
804
- yarn --version
805
- ```
806
-
807
- Expected output (version numbers may vary):
808
-
809
- ```
810
- 1.22.22
811
- ```
812
-
813
- Verify the PATH includes Yarn:
814
-
815
- ```bash
816
- which yarn
817
- ```
818
-
819
- Expected output:
820
-
821
- ```
822
- /c/Program Files (x86)/Yarn/bin/yarn
823
- ```
824
-
825
- Test Yarn works:
826
-
827
- ```bash
828
- yarn config list
829
- ```
830
-
831
- #### Troubleshooting
832
-
833
- **Problem**: `yarn: command not found` in Git Bash
834
-
835
- **Solution**: Yarn may not be in PATH or Git Bash was opened before installation completed. First, close and reopen Git Bash. Then verify the PATH includes Yarn:
836
-
837
- ```bash
838
- echo $PATH | tr ':' '\n' | grep -i yarn
839
- ```
840
-
841
- If Yarn is not in PATH, add it to your `~/.bashrc`:
842
-
843
- ```bash
844
- echo 'export PATH="$PATH:/c/Program Files (x86)/Yarn/bin"' >> ~/.bashrc
845
- source ~/.bashrc
846
- ```
847
-
848
- **Problem**: `the input device is not a TTY` error with interactive commands
849
-
850
- **Solution**: Git Bash's mintty terminal has TTY compatibility issues. Use the `winpty` prefix for interactive commands:
851
-
852
- ```bash
853
- winpty yarn
854
- ```
855
-
856
- Or add an alias to your `~/.bashrc`:
857
-
858
- ```bash
859
- echo 'alias yarn="winpty yarn"' >> ~/.bashrc
860
- source ~/.bashrc
861
- ```
862
-
863
- **Problem**: Path conversion issues (Unix paths being converted to Windows paths)
864
-
865
- **Solution**: Git Bash automatically converts Unix-style paths. To prevent this for specific commands, set `MSYS_NO_PATHCONV`:
866
-
867
- ```bash
868
- MSYS_NO_PATHCONV=1 yarn add /path/to/local/package
869
- ```
870
-
871
- ---
872
-
873
- ## Post-Installation Configuration
874
-
875
- After installing Yarn on any platform, consider these optional but recommended configurations.
876
-
877
- ### Verify Yarn is Working
878
-
879
- Test Yarn by checking its version and configuration:
880
-
881
- ```bash
882
- yarn --version
883
- yarn config list
884
- ```
885
-
886
- ### Set Default Registry
887
-
888
- Yarn uses the npm registry by default. To verify or set the registry:
889
-
890
- ```bash
891
- yarn config get registry
892
- ```
893
-
894
- Expected output:
895
-
896
- ```
897
- https://registry.yarnpkg.com
898
- ```
899
-
900
- To use the npm registry instead:
901
-
902
- ```bash
903
- yarn config set registry https://registry.npmjs.org
904
- ```
905
-
906
- ### Configure Yarn Initialization Defaults
907
-
908
- Set default values for `yarn init`:
909
-
910
- ```bash
911
- yarn config set init-author-name "Your Name"
912
- yarn config set init-author-email "your.email@example.com"
913
- yarn config set init-license "MIT"
914
- ```
915
-
916
- ### Configure Offline Mirror (Optional)
917
-
918
- For offline installations or faster CI/CD, configure a local cache:
919
-
920
- ```bash
921
- yarn config set yarn-offline-mirror ./npm-packages-offline-cache
922
- yarn config set yarn-offline-mirror-pruning true
923
- ```
924
-
925
- ### Upgrade to Yarn Modern (Per-Project)
926
-
927
- If a project requires Yarn 2+ (Berry), use Corepack after installing Node.js 16.10+:
928
-
929
- ```bash
930
- corepack enable
931
- cd /path/to/your/project
932
- yarn set version stable
933
- yarn install
934
- ```
935
-
936
- This creates project-specific Yarn configuration without affecting your global Yarn Classic installation.
937
-
938
- ---
939
-
940
- ## Common Issues
941
-
942
- ### Issue: "There appears to be trouble with your network connection"
943
-
944
- **Symptoms**: Yarn cannot download packages, displays network retry messages
945
-
946
- **Solutions**:
947
-
948
- - Check your internet connection
949
- - If behind a corporate proxy, configure Yarn:
950
-
951
- ```bash
952
- yarn config set proxy http://proxy.example.com:8080
953
- yarn config set https-proxy http://proxy.example.com:8080
954
- ```
955
-
956
- - Increase network timeout:
957
-
958
- ```bash
959
- yarn config set network-timeout 300000
960
- ```
961
-
962
- ### Issue: "Integrity check failed" or Checksum Mismatch
963
-
964
- **Symptoms**: `error Integrity check failed for "package-name"`
965
-
966
- **Solutions**:
967
-
968
- - Clear the Yarn cache:
969
-
970
- ```bash
971
- yarn cache clean
972
- ```
973
-
974
- - Delete `yarn.lock` and `node_modules`, then reinstall:
975
-
976
- ```bash
977
- rm -rf node_modules yarn.lock
978
- yarn install
979
- ```
980
-
981
- ### Issue: Permission Denied Errors
982
-
983
- **Symptoms**: `EACCES: permission denied` when running Yarn commands
984
-
985
- **Solutions**:
986
-
987
- - Do not use `sudo` with Yarn - it creates permission issues
988
- - Fix npm global directory permissions:
989
-
990
- ```bash
991
- mkdir -p ~/.npm-global
992
- npm config set prefix '~/.npm-global'
993
- echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc # or ~/.zshrc on macOS
994
- source ~/.bashrc
995
- ```
996
-
997
- ### Issue: Yarn Classic vs Modern Confusion
998
-
999
- **Symptoms**: Different Yarn behavior or commands across projects
1000
-
1001
- **Solutions**:
1002
-
1003
- - Check which version a project uses:
1004
-
1005
- ```bash
1006
- yarn --version
1007
- ```
1008
-
1009
- - Yarn 1.x uses `yarn.lock` and `node_modules`
1010
- - Yarn 2+ may use `.yarnrc.yml`, `.pnp.cjs`, and `.yarn/` directory
1011
- - To use a specific version per-project:
1012
-
1013
- ```bash
1014
- # For Yarn Modern
1015
- corepack enable
1016
- yarn set version stable
1017
-
1018
- # For Yarn Classic
1019
- yarn set version classic
1020
- ```
1021
-
1022
- ### Issue: "The engine 'node' is incompatible with this module"
1023
-
1024
- **Symptoms**: Yarn refuses to install packages due to Node.js version mismatch
1025
-
1026
- **Solutions**:
1027
-
1028
- - Check your Node.js version:
1029
-
1030
- ```bash
1031
- node --version
1032
- ```
1033
-
1034
- - Install the required Node.js version (use nvm for version management)
1035
- - To ignore engine checks (not recommended for production):
1036
-
1037
- ```bash
1038
- yarn install --ignore-engines
1039
- ```
1040
-
1041
- ### Issue: Slow Installation Times
1042
-
1043
- **Symptoms**: `yarn install` takes very long
1044
-
1045
- **Solutions**:
1046
-
1047
- - Check if offline mirror is configured and populated
1048
- - Use `--prefer-offline` for cached packages:
1049
-
1050
- ```bash
1051
- yarn install --prefer-offline
1052
- ```
1053
-
1054
- - For CI/CD, use `--frozen-lockfile` to skip resolution:
1055
-
1056
- ```bash
1057
- yarn install --frozen-lockfile
1058
- ```
1059
-
1060
- ---
1061
-
1062
- ## References
1063
-
1064
- - [Yarn Official Website](https://yarnpkg.com/)
1065
- - [Yarn Classic Documentation](https://classic.yarnpkg.com/)
1066
- - [Yarn Installation Guide (Modern)](https://yarnpkg.com/getting-started/install)
1067
- - [Yarn Classic Installation Guide](https://classic.yarnpkg.com/lang/en/docs/install/)
1068
- - [Yarn GitHub Repository (Classic 1.x)](https://github.com/yarnpkg/yarn)
1069
- - [Yarn GitHub Repository (Modern/Berry)](https://github.com/yarnpkg/berry)
1070
- - [Homebrew Yarn Formula](https://formulae.brew.sh/formula/yarn)
1071
- - [Chocolatey Yarn Package](https://community.chocolatey.org/packages/yarn)
1072
- - [Yarn APT/RPM Repository](https://github.com/yarnpkg/releases)
1073
- - [Node.js Corepack Documentation](https://nodejs.org/api/corepack.html)
1074
- - [Yarn Corepack Integration](https://yarnpkg.com/corepack)