pty.js icon indicating copy to clipboard operation
pty.js copied to clipboard

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".

Open javruben opened this issue 10 years ago • 41 comments

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! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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?

javruben avatar Feb 12 '14 14:02 javruben

Install a visual studio express 2013(desktop with c++ redist), this will help

AndrewGrachov avatar Mar 28 '14 16:03 AndrewGrachov

Thanks! It helped!

gregorymachon avatar May 28 '14 20:05 gregorymachon

Surely a whole 8GB of IDE aren't needed just to get this working? Is there not a smaller option?

simonfanz avatar Feb 09 '15 20:02 simonfanz

You can try also Microsoft build tools teh standalone package,

But a general recomendation - use mac or ubuntu :)

AndrewGrachov avatar Feb 10 '15 05:02 AndrewGrachov

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?

juancancela avatar Mar 25 '15 02:03 juancancela

I'm having the exact same problem. Tried to get version 2, got version 12.

mix3d avatar May 15 '15 17:05 mix3d

Got this as well. Not sure if it has to do with either Windows 10 or Visual Studio RC 2015

Martinspire avatar May 22 '15 18:05 Martinspire

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.

bchintx avatar Jul 23 '15 16:07 bchintx

i have the same problem,when i intsall msbt 2013,it doen't work .

how do you reslove?

TNT-Likely avatar Aug 08 '15 16:08 TNT-Likely

@bchintx

TNT-Likely avatar Aug 08 '15 16:08 TNT-Likely

@javruben @nicolasximenes

TNT-Likely avatar Aug 08 '15 16:08 TNT-Likely

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?

shawmanz32na avatar Aug 20 '15 01:08 shawmanz32na

thanks,i reslove it by add --msvs_version=2013 . @shawmanz32na

TNT-Likely avatar Aug 20 '15 02:08 TNT-Likely

@TNT-Likely Where did you add the --msvs_version switch? I'm encountering this error way down the chain of a yeoman generation, and don't know where I can specify the switch...

shawmanz32na avatar Aug 20 '15 16:08 shawmanz32na

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 --global to tell NPM to always use a different MSVS version. Thanks goes to http://stackoverflow.com/a/22411007/1342760

shawmanz32na avatar Aug 20 '15 21:08 shawmanz32na

good

joinee0208 avatar May 24 '16 01:05 joinee0208

@TNT-Likely

i reslove it by add --msvs_version=2013

Where did you add it to? To your morning smoothie? Express your ideas more precise, please

wzup avatar Nov 16 '16 11:11 wzup

@shawmanz32na

Didn't work for me

error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found.

wzup avatar Nov 16 '16 12:11 wzup

open up a new cmd as administrator and run this command: npm install --global --production windows-build-tools then npm config set msvs_version 2015 --global close 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 again

mokanfar avatar Mar 04 '17 04:03 mokanfar

For anyone using Yarn, the above comment worked for me after running the same command with Yarn.

So, for anyone skimming:

$ npm install --global --production windows-build-tools
$ yarn config set msvs_version 2015 --global

joeyespo avatar Oct 30 '17 17:10 joeyespo

FYI pty.js has been forked into https://github.com/Tyriar/node-pty, you can check out the improvements made on the releases page (v0.4.1 was the first release).

Tyriar avatar Oct 30 '17 18:10 Tyriar

Thanks for the suggestions @mokanfar . Your solution resolved my issue.

chrisVillanueva avatar Dec 03 '17 07:12 chrisVillanueva

mokanfar, it`s helped me! Thanks

chebotarevmichael avatar Feb 04 '18 10:02 chebotarevmichael

thank you all

ramzgt avatar Feb 22 '18 14:02 ramzgt

wow saved my day! Thanks

h3nn3 avatar Mar 06 '18 14:03 h3nn3

Thanks All Of you for save my day

AmmarAshfaq avatar Mar 22 '18 08:03 AmmarAshfaq

Thanks All

mohammedPoolwala avatar May 14 '18 04:05 mohammedPoolwala

just run npm install --global --production windows-build-tools

anvarknian avatar May 23 '18 14:05 anvarknian

@mokanfar 's comment helped to fix one error, but another showed up:

... fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasGradient.cc) ...

EDIT: fixed by doing a manual install.

GuiRitter avatar Aug 07 '18 21:08 GuiRitter

Open cmd with administrator and write this command: npm install --global --production windows-build-tools

rafadastan avatar Jan 03 '19 00:01 rafadastan