I was trying to install node module printer "npm install printer" and got few errors while trying few solutions that I found in different blogs, forums and stackoverflow sites.
I would like to share what worked for me at the end.
 Uninstall all Microsoft Visual C++ except the latest one.
I have installed 2015 - https://www.microsoft.com/en-us/download/details.aspx?id=49983 (Microsoft Visual C++ Build Tools 2015 Technical Preview)
npm config set msvs_version 2015 --global
 Install Python version < 3.0.
I have Python 2.7.11 installed at C:\Python27 and added to windows path.
npm config set python python2.7 --global npm config set python C:\Python27\python.exe --global
If you have windows 32 bit machine, run this:
set VCTargetsPath=C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\v140
If you have windows 64 bit machine, run this:
set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140
After those steps I opened new CMD window and run "npm install printer --save" and it installed perfectly this time.
 Some of the errors I was getting were:
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\_projects\node projects\printer\node_modules\printer\build\binding.sln] gyp ERR! build error
vcbuild.exe : error VCBLD0010: Project 'C:\_projects\node projects\printtest\node_modules\printer\build\node_printer.vcproj' requires upgrade. Use 'vcbuild /upgrade' or 'devenv /upgrade' to upgrade the project.
vcbuild.exe : error VCBLD0010: Project 'config' requires upgrade. Use 'vcbuild /upgrade' or 'devenv /upgrade' to upgrade the project.
npm ERR! [email protected] install: 'node-gyp rebuild'npm ERR! Exit status 1npm ERR!npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the printer package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! node-gyp rebuildnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs printernpm ERR! Or if that isn't available, you can get their info via:npm ERR! npm owner ls printernpm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:npm ERR! C:\_projects\node projects\printtest\npm-debug.log
Check these urls for more ideas:
swathi posted on - Wednesday 31st of May 2017 12:50:38 AM