Unable to install Sage / dependencies: "Cannot find module 'browserslist'"

Hi there,

I am having massive issues with installing Sage and have already been in touch with my server support in order to sort things out but it seems that this is a theme-specific problem…

What happens exactly?
After editing my server environment following the hoster’s guidelines, setting up a clean WordPress-installation and going through all the steps laid out with your docs I am seeing this error message when trying to run “gulp” for the first time:

module.js:338
throw err;
      ^
Error: Cannot find module 'browserslist'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/var/www/virtual/famgbr/html/wp-content/themes/fam-gbr/node_modules/gulp-autoprefixer/node_modules/autoprefixer-core/lib/autoprefixer.js:6:18)
    at Object.<anonymous> (/var/www/virtual/famgbr/html/wp-content/themes/fam-gbr/node_modules/gulp-autoprefixer/node_modules/autoprefixer-core/lib/autoprefixer.js:109:4)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

My dependencies’ versions are as follows:

  • node --version: 0.12.2
  • npm --version: 2.7.4
  • gulp --version: 3.8.11
  • bower --version: 1.4.1

Haven’t hit any other warnings or errors in the course of my setup and my hoster (uberspace.de) is also clueless as to what could be broken other then the theme… I am not saying it is though, just cannot figure out how to debug this.

Please advise!
Thanks + regards,

Henning

P.S.: I can provide the full terminal log if that helps to analyse the whole thing…

Yeah gist it please. Also tell us more about what kind of server you are running.

It’s possible that your environment is subject to some kind of race condition with npm. Try blasting node_modules and running npm install again. rm -r node_modules and then npm install

Hi Austin,

thanks for getting back. I’ve gisted my terminal log here and here are some server-specs (full info / list here, in German though):

  • CentOS 6
  • Apache 2.2
  • suEXEC
  • Node.js pre-installed

I ran rm -r node_modules and npm install inside my theme folder like you said but no changes – still throws the same error when I gulp

Hey there,

did anyone have a chance to further look into this? It’s pressing a bit since I can’t really develop the site with Sage…

Thanks!

What else have you done to look into it? This is an error on your end / environment.

Same issue here.

Error: Cannot find module 'browserslist'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/user/bedrock/web/app/themes/ne
xusev/node_modules/gulp-autoprefixer/node_modules/autoprefixer-core/lib/autopr
efixer.js:6:18)
    at Object.<anonymous> (/home/user/bedrock/web/app/themes/ne
xusev/node_modules/gulp-autoprefixer/node_modules/autoprefixer-core/lib/autopr
efixer.js:109:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Same answer for you - this is not a Sage specific issue.

Are you on Centos as well?

node -v & bower -v & npm -v & gulp -v

[1] 11502
[2] 11503
[3] 11504
v0.10.25
2.9.1
[21:12:59] CLI version 3.8.11
[1]   Done                    node -v
[3]+  Done                    npm -v

Ubuntu 14.04

I see it output Node v0.10.25 however about 30 minutes ago I updated it to v0.12.2 via nvm. Ill try update again. It could have been another bower process that downgraded the Node version.

Running as ‘root’ user seemed to be the only way for me to get bower to install all dependencies. I had to run gulp under root as well.

I switched to developing locally (which has proven to be a good choice on many different levels), so this issue can be archived…

1 Like

This topic is now unlisted. It will no longer be displayed in any topic lists. The only way to access this topic is via direct link.