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=2012Tada. This should work almost every time.
For more Node.js tips, check out my article on using require to load your own files.
About Kevin
Kevin Griffin has been running production .NET applications and teaching developers for over two decades. A 16-time Microsoft MVP specializing in ASP.NET Core and Azure, Kevin brings real-world experience from his own SaaS products alongside his consulting work at Swift Kick. He's hosted the Hampton Roads .NET User Group since 2009 and founded RevolutionVA, the nonprofit behind Hampton Roads DevFest. Kevin's talks blend hard-won lessons from production systems with practical advice you can use Monday morning.
Categories