I’ve updated these instructions to handle some issues syncing NPM with Sage on Ubuntu 14. Sage has become one of the preferred starter themes used by an industry leading WordPress development company. I don’t know how long these specific instructions will work for, but right now they get the job done. Recently I ran into some trouble installing NPM on Sage, here’s the process I followed to successfully get up and running.
- Install Sage https://github.com/roots/sage
- git clone sage and rename your new theme accordingly
- Install NPM globally https://github.com/nodesource/distributions
- curl -sL https://deb.nodesource.com/setup_dev | sudo bash
- sudo apt-get install -y nodejs
- apt-get install -y build-essential
- sudo npm install -g n
- sudo n stable
- The “sudo n stable” is important. Type in the first command, it looks like it finishes something, then do the n stable, and it actually completes the install properly.
- FixNPMpermissioning
- mkdir ~/npm-global
- npm config set prefix ‘~/npm-global’export PATH=~/npm-global/bin:$PATH
- source ~/.profile
- sudo npm cache clean
- Install Gulp and BowergloballyusingNPM
- sudo npm install -g gulp bower
- RunNPM install from the theme directory
- cd /var/www/bedrock/web/app/themes/sage
- npm install
- If you have a throw err, manually install the npm dependency
- In my last install here’s what I did:
- npm install –save-dev browser-sync
- bower install
- gulp
If you have any questions or feedback about these instructions please leave a comment.