Specifying Visual Studio Version in NPM Installs

Sometimes when you install a NPM package, you’ll run into an issue like this:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(35,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = ‘v100’) cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select “Update VC++ Projects…”. Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.
Normally you’ll get this if you’re only running VS2012 and it wants VS2010/VS2008. You can ask NPM to use Visual Studio 2012 instead by using with “–msvs_version=2012” command.

Example:

npm install socket.io –msvs_version=2012
Tada. This should work almost every time.

Originally published on 2013-05-14 in Development

Enjoy this article? Let's keep in touch

I really appreciate you taking the time out of your schedule to read this post. I like to keep my friends updated on new articles and also spawn discussions here and there.

If you'd like to keep in touch, please subscribe below. And I promise, no more than 1 email per week (if even that).