"npm install karma" fails on windows
See original GitHub issueI have the latest version of node installed:
C:\>npm -v
2.14.4
C:\>node -v
v4.1.2
I try installing karma via the docs and I get the following console output:
C:\xyz>npm install karma --save-dev
npm WARN optional dep failed, continuing fsevents@1.0.2
> bufferutil@1.2.1 install C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
> utf-8-validate@1.2.1 install C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.2.1
> utf-8-validate@1.2.1 install C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
> bufferutil@1.2.1 install C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xyz\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
npm WARN optional dep failed, continuing bufferutil@1.2.1
karma@0.13.10 node_modules\karma
βββ di@0.0.1
βββ graceful-fs@4.1.2
βββ rimraf@2.4.3
βββ mime@1.3.4
βββ colors@1.1.2
βββ http-proxy@1.11.2 (eventemitter3@1.1.1, requires-port@0.0.1)
βββ dom-serialize@2.2.0 (custom-event@1.0.0, void-elements@1.0.0, extend@2.0.1, ent@2.2.0)
βββ source-map@0.4.4 (amdefine@1.0.0)
βββ useragent@2.1.7 (lru-cache@2.2.4)
βββ glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, inflight@1.0.4, once@1.3.2)
βββ minimatch@2.0.10 (brace-expansion@1.1.1)
βββ bluebird@2.10.2
βββ optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
βββ connect@3.4.0 (utils-merge@1.0.0, parseurl@1.3.0, debug@2.2.0, finalhandler@0.4.0)
βββ body-parser@1.14.1 (bytes@2.1.0, content-type@1.0.1, depd@1.1.0, qs@5.1.0, raw-body@2.1.4, on-finished@2.3.0, http-errors@1.3.1, debug@2.2.0, iconv-lite@0.4.12, type-is@1.6.9)
βββ expand-braces@0.1.1 (array-uniq@1.0.2, array-slice@0.2.3, braces@0.1.5)
βββ chokidar@1.2.0 (path-is-absolute@1.0.0, arrify@1.0.0, glob-parent@2.0.0, async-each@0.1.6, is-glob@2.0.1, is-binary-path@1.0.1, lodash.flatten@3.0.2, readdirp@2.0.0, anymatch@1.3.0)
βββ log4js@0.6.27 (async@0.2.10, underscore@1.8.2, semver@4.3.6, readable-stream@1.0.33)
βββ lodash@3.10.1
βββ socket.io@1.3.7 (debug@2.1.0, has-binary-data@0.1.3, socket.io-parser@2.2.4, socket.io-adapter@0.3.1, engine.io@1.5.4, socket.io-client@1.3.7)
βββ core-js@1.2.1
βββ memoizee@0.3.9 (lru-queue@0.1.0, next-tick@0.2.2, d@0.1.1, timers-ext@0.1.0, event-emitter@0.3.4, es6-weak-map@0.1.4, es5-ext@0.10.8)
The first error seems to be that there is something configured wrong β but I donβt know what, since there are no steps to configure anything before running the command.
The second error I see is that python is required (there is no mention of this requirement in the docs, is this legitimate? do we really need to install python too?).
Iβm guessing the rest of the errors will change once those two are figured out.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Installing Karma failed - angularjs - Stack Overflow
js 'karma' is not recognized as an internal or external command (so a windows installation). However there seems to be a karma in....
Read more >Karma - npm
Start using karma in your project by running `npm i karma`. There are 1198 other projects in the npm registry using karma.
Read more >Troubleshooting - Karma test runner
This is a common Windows issue, the compilation of the native ws module fails. Anyways, ws has a fallback JS implementation which NPM...
Read more >Karma installation error - Discussion - BMC Community
Karma installation error Β· 1. Run Command Prompt as Administrator. (On Windows, Start --> Right Click on Command Prompt --> Run as Administrator)....
Read more >Karma | IntelliJ IDEA Documentation - JetBrains
For Windows: npm install -g karma-cli karma init. Answering the questions of the wizard, specify the testing framework to use and the browsers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
But this is no problem with karma itself. I think itβs strange for npm to show optional dependencies a way everyone things itβs a critical error. The karma team canβt do anything about it. The only thing they could do is remove the dependencies, but this would be stupid, and not helpful at all.
I guess this has to be discussed with the guys from npm (pls check if there is already an issue open, I didnβt see one.
This errors are optional dependencies, so you can ignore them and still use karma.
The point is, that some dependencies try to use some native code, that they want to compile via node-gyp (and node-gyp requires python). But they only try, so if they fail, they fall back to another (slower) implementation.
So this is actually not a problem with karma itself, itβs just the uncool presentation of npm that causes some confusion here I guess.
You do NOT need node-gyp or python for karma.