Search code examples
node.jsyeomanyeoman-generator

Run Yeoman Generator under Windows with npm switches


Under Windows 8.1, have npm working fine, but generally run it with the --msvs_version=2012 switch, in case any modules require building.

Have got yeoman + a generator installed fine, but when executing the yo xxxx command to run the generator (in this case, the generator is meanjs), how do I get npm commands to run with the same switch I would use when running them individually?

Right now, module builds return errors, and then subsequent dependencies are not met, bringing the generator to a halt.


Solution

  • You can setup npm globally

    npm config set msvs_version 2013 --global

    Please, give it a try.

    I took the idea from a comment of the following article:

    http://kevgriffin.com/specifying-visual-studio-version-in-npm-installs/