pty.js: MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
When running npm install pty.js on windows I get:
C:\cygwin\opts\newclient\node_modules\pty.js>node “C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin.…\node_modules\node-gyp\bin\node-gyp.js” rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch.
MSBUILD : error MSB4132: The tools version “2.0” is unrecognized. Available tools versions are “4.0”.
gypnpm ERR! pty.js@0.2.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js@0.2.3 install script.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200 npm ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “pty.js” npm ERR! cwd C:\cygwin\opts\newclient npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.24 npm ERR! code ELIFECYCLE
I have installed winpty, but apparently I’m missing some tools. What do I need more?
About this issue
- Original URL
- State: open
- Created 10 years ago
- Reactions: 17
- Comments: 41
Commits related to this issue
- Consolidate demo and example folders Fixes #60 — committed to ddm/pty.js by Tyriar 7 years ago
open up a new cmd as administrator and run this command:
npm install --global --production windows-build-toolsthennpm config set msvs_version 2015 --globalclose all instances of shell/cmd, reopen a cmd (regular this time, non-administrator) return to your directory where you are trying to run npm install and run it againYou can try also Microsoft build tools teh standalone package,
But a general recomendation - use mac or ubuntu 😃
For those of us following along that are encountering this error deep down in an NPM call, you can use
npm config set msvs_version 2012 --globalto tell NPM to always use a different MSVS version. Thanks goes to http://stackoverflow.com/a/22411007/1342760Surely a whole 8GB of IDE aren’t needed just to get this working? Is there not a smaller option?
@TNT-Likely
Where did you add it to? To your morning smoothie? Express your ideas more precise, please
For anyone using Yarn, the above comment worked for me after running the same command with Yarn.
So, for anyone skimming:
Sadly installing Microsoft Build Tools (as mentioned on previous message) wont work, since it installs “12.0”. Basically, you’ll get something like this: MSBUILD : error MSB4132: The tools version “2.0” is unrecognized. Available tools versions are “12.0”, “4.0”. I used Linux all my life, but due to a Xamarin project im working on, i needed to switch to windows. This is hell. None of my NodeJs projects are working, and the only error im getting is the previous one. Do you think is there any chance to allow using 4.0 and 12.0 with gyp?
If you’re seeing this in 2019, you may need
npm config set msvs_version 2017@shawmanz32na
Didn’t work for me
thanks,i reslove it by add --msvs_version=2013 . @shawmanz32na
I was able to compile it by running (as administrator):
and then performing the usual steps as a regular user.
just run
npm install --global --production windows-build-toolsI’m having the exact same problem. Tried to get version 2, got version 12.
For anyone, who see this error and did not find solution. I found solution for my project. I has node.js 12.x installed via Chocolatey. I uninstalled node.js version 12.x and installed node.js version 10.x from the installer at the official site.
I can also attest to this error. On Windows 10 x64, I see
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "12.0", "14.0", "4.0".Installing the latest msbuild toolkits got me the 12.0 and 14.0 options. Looking at my Windows/Microsoft.Net folder, it looks like I have every 32 bit .NET version known to man, but only .NET 4 in 64 bit. Maybe that could help lead to a solution?@NeliHarbuzava thank you so much. Saved me a lot of time.
I uninstalled nodejs via chocolatey and then installed the https://chocolatey.org/packages/nodejs-lts package instead (long term support) which is version 10.x.
👍 ❤️
Open cmd with administrator and write this command: npm install --global --production windows-build-tools
I was getting the same error as reported above. Installing the Microsoft Build Tools 2013 from the above links didn’t work for me either. It only installed version 12.0, so I still received an error re: version 2.0. Fortunately, its working now after I upgraded Node to the latest build (12.7). I was running 10.38 before.
Install a visual studio express 2013(desktop with c++ redist), this will help