Experience issues installing NPM in the sage theme directory. I’ve completed over 20 installs of Roots and Bedrock + Sage and have never run into this. Does anyone have any ideas on what the issue is here?
user@host:/var/www/bedrock/web/app/themes/sage$ npm install
npm WARN unmet dependency /var/www/bedrock/web/app/themes/sage/node_modules/asset-builder/node_modules/main-bower-files requires minimatch@'^1.0.0' but will load
… (and the list continued).
Tried moving the node_modules directory and running “npm install”. The result was “Process Killed” after waiting about 15 minutes. Check the node_modules directory and some modules are there, but it seems incomplete. Any recommendations?
This isn’t an issue with Sage, this is an issue with your environment.
Googling your error brings up lots of results. What have you tried besides removing the node_modules directory, and have you tried that multiple times?
This isn’t the appropriate place for Node support. Stack Overflow is better suited for these types of questions.
Same situation as Michael - we’ve deployed a ton of Roots/Sage sites in the past, and this is only just happening… I work on a Sage site of some sort every single day, and the first one I provision today this happened.
I’ve now (probably) made the problem worse by trying to fix…
OK, I have fixed it, although I have no idea why it suddenly happened… I (as I’m sure is the case with many devs) haven’t shut my macbook down in a week or so, I just close the lid… I was working absolutely fine on a Sage 8.1 site yesterday, and nothing has changed on my laptop… so why it would get screwy today (on the same day as you) after working perfectly for 18 months, through the ages and ascension of Roots & Sage… I have no idea…
I only actually found this thread thru Googling for the problem.
@ben Sorry for posting an environment issue. For what it’s worth the feedback from you and Doug was very helpful, and ultimately lead me to resolving the issue.
@doug Good call on the $sudo npm install -g n, $sudo n stable. I basically just started fresh, installing node and npm according to the nodesource guidelines for Ubuntu.
One key issue to note is even after performing a strict install of node and npm, I still ran into problems with ‘npm install’ and ‘gulp’ commands in the theme directory. After running ‘npm install’ in the theme directory, I was returned with a thow err, as some dependencies were missing. I resolved the error by manually installing the missing dependency which in this case was browser-sync. I’ve posted more detailed instructions on TutorialShares. In case anyone reading this is running into the same issue with their install on Ubuntu, here’s what I did.
Agreed, especially since NPM includes nodejs. I’m not happy with this method and look forward to correcting it, but at the end of that day, it got the job done.
In previous installs I could get away with a simple $ apt-get install npm. Then write a link to correct now the nodejs directory was named $ln -s /usr/bin/nodejs /usr/bin/node.
On my last couple of installs that method no longer seemed to work. I’ll try out NVM next time, but ultimately I’d like to have a formula for running this install consistently using NPM.
I’ll also try to wean myself off of apt-get and just install NPM directly like this:
$ curl -L https://npmjs.org/install.sh | sh
Always glad to hear feedback or tips, thanks @Austin!