diff --git a/lib/ansible/modules/extras/packaging/language/npm.py b/lib/ansible/modules/extras/packaging/language/npm.py index 53ce1e77c5e..e15bbea903e 100644 --- a/lib/ansible/modules/extras/packaging/language/npm.py +++ b/lib/ansible/modules/extras/packaging/language/npm.py @@ -252,7 +252,10 @@ def main(): elif state == 'latest': installed, missing = npm.list() outdated = npm.list_outdated() - if len(missing) or len(outdated): + if len(missing): + changed = True + npm.install() + if len(outdated): changed = True npm.update() else: #absent