argument('version'); $this->info('Nodejs installing...'); system('curl -sL https://deb.nodesource.com/setup_'.$version.'.x | sudo -E bash -'); // @TODO apt add a Warning for no good, in a later version output will be scanned for helpfull infos exec('apt-get install -y nodejs 2>&1', $output); $this->line(implode("\n", Install::filterAptMessages($output))); $this->info('Nodejs add user...'); system('useradd -d /home/nodejs -m nodejs'); system('sudo -Hu nodejs mkdir /home/nodejs/.npm'); system('sudo -Hu nodejs npm config set prefix /home/nodejs/.npm'); system('echo -e "export PATH=/home/nodejs/.npm/bin:\$PATH" >> /home/nodejs/.bashrc'); $this->info('Nodejs install npm & pm2...'); system('npm install -g npm && npm install -g pm2'); // check if nginx is ready and installed if (Install::isReady('nodejs')) { $this->info('Nginx installing...Success! \o/'); } else { $this->error('Failed! Please check log-file!'); } } }