npm¶
Description¶
This Ansible role installs npm and optionally runs npm ci within a given project directory. It is intended to streamline dependency installation for Node.js applications.
Overview¶
Designed for use in Node-based projects, this role installs npm and can execute a clean install (npm ci) to ensure consistent dependency trees.
Features¶
npm Installation: Ensures the
npmpackage manager is installed.Optional Project Setup: Runs
npm ciin a specified folder to install exact versions frompackage-lock.json.Idempotent: Skips
npm ciif no folder is configured.
Configuration¶
Set npm_project_folder to a directory containing package.json and package-lock.json:
vars:
npm_project_folder: /opt/scripts/my-node-project/
License¶
Infinito.Nexus NonCommercial License https://s.infinito.nexus/license