From cb8b77aba8dbaba6c7cb70bf324fe702a83264eb Mon Sep 17 00:00:00 2001 From: Lukas Riedersberger Date: Thu, 4 Jan 2024 09:46:59 +0100 Subject: [PATCH] Fix running npm package forever in chapter 4 This addresses an issue in the nodejs example of chapter 4. On some systems the path to the binary of the npm package 'forever' might not be `/usr/local/bin/forever`. Fixed by instead using `npx` to run it. --- nodejs/provisioning/playbook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodejs/provisioning/playbook.yml b/nodejs/provisioning/playbook.yml index deb82db7..5030e081 100644 --- a/nodejs/provisioning/playbook.yml +++ b/nodejs/provisioning/playbook.yml @@ -38,10 +38,10 @@ npm: "path={{ node_apps_location }}/app" - name: Check list of running Node.js apps. - command: /usr/local/bin/forever list + command: npx forever list register: forever_list changed_when: false - name: Start example Node.js app. - command: "/usr/local/bin/forever start {{ node_apps_location }}/app/app.js" + command: "npx forever start {{ node_apps_location }}/app/app.js" when: "forever_list.stdout.find(node_apps_location + '/app/app.js') == -1"