Issue with theme directory npm installation

My issue arose when running npm install in my theme directory. I had already successfully installed gulp and bower globally as per the Requirements on the Sage GitHub page:

Requirements

  • PHP >= 5.4
  • Node.js >= 0.10
  • npm >= 2.1.5
  • gulp (npm install -g gulp)
    Bower (npm install -g bower)

My limited experience with npm (and the CLI in general, tbh – I am making a big effort to learn) means unfortunately I can’t make any comment on the errors thrown, but here is the link to my npm-debug.log file; hopefully that will help.

If there is any more information I can provide, I’m happy to do so.

Thanks in advance for the help, and for such a great resource.

Dave.

Your debug log link isn’t working for me, could you make a gist out of it?

Sure thing, here it is: https://gist.github.com/anonymous/d4e2f2b9780e79a129b2#file-npm-debug-log

135727 error node v0.12.0
135728 error npm v2.5.0

Just a shot, but I have had issues with newer versions of npm/node. Rolling back to the versions in my thread was the only thing that seemed to help me.

@ewafford Thanks for the advice, Eric.

Ha I’ll have a wrestle with nvm, it’s a little above my CLI-wielding levels, but I’ll see how I go rolling back. Enjoying the learning journey.

If you have a suggestion of a way to roll back that’s easier for a beginner than nvm, feel free to pop up a link, but no worries if not.

No worries, gotta start somewhere, and I’m only a few CLI levels above you so don’t sweat it.

I assume you are running on mac/linux (mac for me) - I simply followed the instructions here: https://github.com/creationix/nvm

Then used the nvm install command to install the version of node I mentioned in the other thread. You will also want to use nvm alias to setup a default for use when opening up a shell.

HTH

@ewafford Much appreciated, I’ll give it a go.

@ben In the meantime, let me know if that debug log was helpful at all.

If you don’t get running with nvm, can you try npm install -g npm@latest and then run npm install again?

UPDATE: I got all the packages installed for 7.0.3 (npm install). I used sudo chown -R $(whoami) ~/.npm to reclaim ownership of the .npm directory (I was constantly using sudo, I’m not sure if that was the cause of any of my troubles). I also brought node up to the latest stable version via nvm after having rolled back to an earlier version whilst troubleshooting 8.0.0, and finally reinstalled grunt-cli globally, just to make sure.

Really appreciate all your help, @ewafford @benword, thanks guys.

Original post:

Thanks @benword – I gave that a try, though no success.

I’ve decided to use 7.0.3 for now, as I figure my inexperience with packages like gulp, node etc is getting in the way. I was able to get 7.0.3 up and running before with little to no trouble – although now I’m having similar difficulty with installing npm (where I didn’t have any before trying 8.0.0).

Here’s some Terminal output which may be helpful, as well as my most recent log file:

bootstrap#3.3.1 assets/vendor/bootstrap
└── jquery#1.11.1
sh: grunt: command not found

npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/lib/node_modules/nvm/versions/node/v0.12.0/bin/node" "/usr/local/lib/node_modules/nvm/versions/node/v0.12.0/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! roots@7.0.3 postinstall: `node node_modules/bower/bin/bower install && grunt dev`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the roots@7.0.3 postinstall script 'node node_modules/bower/bin/bower install && grunt dev'.
npm ERR! This is most likely a problem with the roots package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/bower/bin/bower install && grunt dev
npm ERR! You can get their info via:
npm ERR!     npm owner ls roots
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Dave/Dropbox/__theagsc/_localsites/theagsc/wp-content/themes/theagsc/npm-debug.log

Debug log file: https://gist.github.com/anonymous/4d9b7e861d07491ec92b

Also should I move this to another Category, as I’m now using 7.0.3?

1 Like

Thanks. This worked for me too.

1 Like