|
@ -43,21 +43,21 @@ class NodejsInstallCommand extends Command |
|
|
|
|
|
|
|
|
$this->info('Nodejs installing...'); |
|
|
$this->info('Nodejs installing...'); |
|
|
|
|
|
|
|
|
exec('curl -sL https://deb.nodesource.com/setup_'.$version.'.x | sudo -E bash -'); |
|
|
|
|
|
exec('apt-get install -y nodejs 2>&1'); |
|
|
|
|
|
|
|
|
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
|
|
|
// @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->line(implode("\n", Install::filterAptMessages($output))); |
|
|
|
|
|
|
|
|
$this->info('Nodejs add user...'); |
|
|
$this->info('Nodejs add user...'); |
|
|
exec('useradd -d /home/nodejs -m nodejs', $output); |
|
|
|
|
|
|
|
|
system('useradd -d /home/nodejs -m nodejs'); |
|
|
|
|
|
|
|
|
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'); |
|
|
|
|
|
|
|
|
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...'); |
|
|
$this->info('Nodejs install npm & pm2...'); |
|
|
exec('npm install -g npm && npm install -g pm2'); |
|
|
|
|
|
|
|
|
system('npm install -g npm && npm install -g pm2'); |
|
|
|
|
|
|
|
|
// check if nginx is ready and installed
|
|
|
// check if nginx is ready and installed
|
|
|
if (Install::isReady('nodejs')) { |
|
|
if (Install::isReady('nodejs')) { |
|
|