From b91319846c364030074726fba73e76f19713e69d Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 24 Jul 2026 10:32:42 +0200 Subject: windows: eigene npmrc-Variante ohne ${HOME} (npm/npmrc-win) npm/npmrc setzt prefix=${HOME}/.local, damit globale npm-Installationen ohne sudo/root ins Home-Verzeichnis gehen. HOME ist unter Windows i.d.R. nicht gesetzt, ${HOME} wuerde also nicht expandieren. npm/npmrc-win laesst prefix komplett weg - npm nutzt unter Windows ohnehin schon %APPDATA%\npm als Praefix, von Node's eigenem Installer automatisch zum PATH hinzugefuegt, kein Workaround noetig. install-win.ps1 und neovim-windows-setup.md entsprechend angepasst. npm/npmrc (POSIX) bleibt unveraendert. --- install-win.ps1 | 4 ++-- neovim-windows-setup.md | 2 +- npm/npmrc-win | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 npm/npmrc-win diff --git a/install-win.ps1 b/install-win.ps1 index 632c25e..e52c0cb 100644 --- a/install-win.ps1 +++ b/install-win.ps1 @@ -41,7 +41,7 @@ $GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" $GitXdgDir = Join-Path $env:USERPROFILE ".config\git" $GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" -$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" +$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc-win" $NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" function Copy-NvimConfig { @@ -75,7 +75,7 @@ function Copy-Npmrc { return } - Write-Step "npm\npmrc -> $NpmrcDst" + Write-Step "npm\npmrc-win -> $NpmrcDst" Copy-Item -Force $NpmrcSrc $NpmrcDst Write-Ok $NpmrcDst } diff --git a/neovim-windows-setup.md b/neovim-windows-setup.md index f7dd1c8..c5fc3fc 100644 --- a/neovim-windows-setup.md +++ b/neovim-windows-setup.md @@ -39,7 +39,7 @@ Es kopiert (keine Symlinks, keine Admin-Rechte nötig): - `nvim/` → `%LOCALAPPDATA%\nvim` - `git/config` → `%USERPROFILE%\.gitconfig` - `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) -- `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) +- `npm/npmrc-win` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) – eigene Windows-Variante ohne `prefix=${HOME}/.local`: `HOME` ist unter Windows i. d. R. nicht gesetzt, npm nutzt dort ohnehin schon von Haus aus `%APPDATA%\npm` als Praefix Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. diff --git a/npm/npmrc-win b/npm/npmrc-win new file mode 100644 index 0000000..3803390 --- /dev/null +++ b/npm/npmrc-win @@ -0,0 +1,26 @@ +; %USERPROFILE%\.npmrc (Windows) +; +; Kein "prefix" gesetzt, anders als in npm/npmrc (POSIX): dort dient +; prefix=${HOME}/.local dazu, globale Installationen ohne sudo/root ins +; Home-Verzeichnis zu legen. Unter Windows loest npm dieses Problem +; bereits selbst - der Standard-Praefix liegt ohnehin im Benutzerprofil +; (%APPDATA%\npm), von Node's eigenem Installer automatisch zum PATH +; hinzugefuegt. ${HOME} ist unter Windows i.d.R. nicht gesetzt und wuerde +; hier nicht expandieren. + +; default registry +registry=https://registry.npmjs.org/ + +; disable fund-spam +fund=false + +; suppresses notifications about new npm versions +update-notifier=false + +; reduce the attack surface for supply chain attacks +min-release-age=3 + +; disable pre- und post-scripts +ignore-scripts=true + +; vim: ft=dosini -- cgit v1.3