PM2 inside bash script deployed by puppet not working
2
votes
1
answer
2141
views
#!/bin/bash
# install needed RPMS
yum -y install gcc-c++ git
# downlaod and compile node
wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
tar -xvzf node-v0.12.7.tar.gz
cd node-v0.12.7
./configure
make
sudo make install
# install pm2 via npm
/usr/local/bin/npm install pm2 -g
# start processes.json
cd /home/admin/Order-Management/
/usr/local/lib/node_modules/pm2/bin/pm2 start processes.json
The above script run perfectly when I run it locally but when I try to execute it with puppet on the client machine the last line throwing the following error.
/usr/bin/env: node: No such file or directory
I am using RedHat 6 master and RedHat 6 client. I saw a solution here
https://stackoverflow.com/questions/30281057/node-forever-usr-bin-env-node-no-such-file-or-director However it's not working for me.
Asked by user2178244
(21 rep)
Sep 8, 2015, 02:43 PM
Last activity: May 3, 2025, 06:04 PM
Last activity: May 3, 2025, 06:04 PM