From 1cc15ca3c23ba1a2b5236432bc62eb652c98972d Mon Sep 17 00:00:00 2001 From: Mauro Porras <167700+mauroporras@users.noreply.github.com> Date: Sun, 25 Apr 2021 12:02:39 -0500 Subject: [PATCH] feat(npm): add alias for `npm i -f` (#8454) As documented in the README, `npm i -f` forces npm to install the specified packages from a remote package registry, even if local copies exist on disk caches. --- plugins/npm/README.md | 1 + plugins/npm/npm.plugin.zsh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugins/npm/README.md b/plugins/npm/README.md index 0b1a2280f..bc627e56f 100644 --- a/plugins/npm/README.md +++ b/plugins/npm/README.md @@ -15,6 +15,7 @@ plugins=(... npm) | `npmg` | `npm i -g` | Install dependencies globally | | `npmS` | `npm i -S` | Install and save to dependencies in your package.json | | `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json | +| `npmF` | `npm i -f` | Force install from remote registries ignoring local cache | | `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory | | `npmO` | `npm outdated` | Check which npm modules are outdated | | `npmV` | `npm -v` | Check package versions | diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 87c68f3fb..93de9cba3 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -27,6 +27,9 @@ alias npmS="npm i -S " # npmd is used by https://github.com/dominictarr/npmd alias npmD="npm i -D " +# Force npm to fetch remote resources even if a local copy exists on disk. +alias npmF='npm i -f' + # Execute command from node_modules folder based on current directory # i.e npmE gulp alias npmE='PATH="$(npm bin)":"$PATH"'