Tuesday, March 1, 2016

npm install karma in windows 8 ends with error TRK0005: Failed to locate: "CL.exe"

I was recently working with Travis-CI to setup CI & CD for a pure browser app/static web site. Details are there in a previous post. Karma is the one decided to use as test runner. Things were good till the time I start installing Karma into local node folder using --user-dev. The error I got is as follows when installing Karma.

Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the
 file specified. [C:\Users\<user name>\AppData\Roaming\npm\node_modules\karma\node_mod

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed with exit code: 1

It turns out though it says NPM module its using lot of C++ inside. Karma cannot be built without C++ compiler. When I googled most of the people are saying it never tested in Windows machines. I was not in a situation to go to a Linux machine for this. After spending more time with google, I could see that it requires VS 2015 with Visual C++ language support.

Reinstalled VS 2015 with C++ features and it worked.

Moral of the story - Open source is still mainly for Linux developers :)

No comments: