Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix running `bower install` and `npm install` on Windows #49

merged 1 commit into from

4 participants


child_process.spawn currently only supports .exe files on Windows. Any better solution?


I prefer this over adding another dependency just for the workaround. I wonder if we should move the logic to generator in another step, though.


Works for me on Win 7 x64. I've patched my generator-angular as well. Thanks @kevva

@sindresorhus sindresorhus merged commit 251cdf8 into from

Not that I can think of. If anyone this. Please chime in.

Thanks @kevva

@kevva kevva deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/index.js
5 app/index.js
@@ -3,6 +3,7 @@ var util = require('util');
var path = require('path');
var spawn = require('child_process').spawn;
var yeoman = require('yeoman-generator');
+var win32 = process.platform === 'win32';
var AppGenerator = module.exports = function Appgenerator(args, options, config) {
@@ -28,8 +29,8 @@ var AppGenerator = module.exports = function Appgenerator(args, options, config)
console.log('\n\nI\'m all done. Just run ' + 'npm install & bower install --dev'.bold.yellow + ' to install the required dependencies.\n\n');
} else {
console.log('\n\nI\'m all done. Running ' + 'npm install & bower install'.bold.yellow + ' for you to install the required dependencies. If this fails, try running the command yourself.\n\n');
- spawn('npm', ['install'], { stdio: 'inherit' });
- spawn('bower', ['install'], { stdio: 'inherit' });
+ spawn(win32 ? 'cmd' : 'npm', [win32 ? '/c npm install' : 'install'], { stdio: 'inherit' });
+ spawn(win32 ? 'cmd' : 'bower', [win32 ? '/c bower install' : 'install'], { stdio: 'inherit' });
Something went wrong with that request. Please try again.