I followed this sense to install a bunch of core dependencies for PHP development, but the one I really needed and I didn't need to be able to work, but I still have to install Node, NPM (and then Grunt and Bower globally) in Vagrant. I saw answers like this one , but it never appears to complete the installation (i.e. I cannot install bower and grunt). There is a nodejs package via apt-get that seems to install Node (and I can install NPM from there), but the version seems too old for Bower, so I turned to the manual approach. Thanks for any help.
Update
Here is my bootstraph.sh file:
#!/usr/bin/env bash echo ">>> Starting Install Script" # Update sudo apt-get update # Install MySQL without prompt sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' echo ">>> Installing Base Items" # Install base items sudo apt-get install -y curl wget build-essential python-software-properties python g++ make echo ">>> Adding PPA and Installing Server Items" # Add repo for latest PHP sudo add-apt-repository -y ppa:ondrej/php5 # Add NodeJS repository sudo add-apt-repository -y ppa:chris-lea/node.js # Update Again sudo apt-get update # Install the Rest sudo apt-get install -y php5 apache2 libapache2-mod-php5 nodejs php5-mysql php5-curl php5-gd php5-mcrypt php5-xdebug mysql-server echo ">>> Configuring Server" # xdebug Config cat << EOF | sudo tee -a /etc/php5/mods-available/xdebug.ini xdebug.scream=1 xdebug.cli_color=1 xdebug.show_local_vars=1 EOF # Apache Config sudo a2enmod rewrite curl https://gist.github.com/fideloper/2710970/raw/5d7efd74628a1e3261707056604c99d7747fe37d/vhost.sh > vhost sudo chmod guo+x vhost sudo mv vhost /usr/local/bin # Symlink /var/www to project web root sudo rm -rf /var/www sudo ln -s /vagrant/ /var/www # PHP Config sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini sudo service apache2 restart echo ">>> Installing NPM, Grunt CLI and Bower" curl https://npmjs.org/install.sh | sh sudo npm install -g grunt-cli bower echo ">>> Installing Composer" # Composer curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer
Zach
source share