Installing packages without pinned versions risks unintentional or malicious dependency upgrades, leading to supply-chain compromises, newly introduced vulnerabilities, or non-reproducible builds.
This rule inspects run command entries that invoke npm install, npm i, or npm add and requires each package argument (excluding command flags) to include an explicit version or tag (for example, package@1.2.3 or @scope/pkg@^1.2.3) or be a git-based reference (for example, git+https://...). Tokens that start with - (npm flags) are allowed. Scoped packages must still include a version suffix and bare package names without an @version will be flagged.