argument('version'); exec('useradd -d /home/nodejs -m nodejs'); exec('curl -sL https://deb.nodesource.com/setup_'.$version.'.x | sudo -E bash -'); exec('apt-get install -y nodejs -qq'); exec('sudo -Hu nodejs mkdir /home/nodejs/.npm'); exec('sudo -Hu nodejs npm config set prefix /home/nodejs/.npm'); exec('echo -e "export PATH=/home/nodejs/.npm/bin:\$PATH" >> /home/nodejs/.bashrc'); exec('npm install -g npm && npm install -g pm2'); // check if nginx is ready and installed if (Install::isReady('nodejs')) { $this->info("Success!"); } else { $this->error("Failed! Please check log-file!"); } } }