question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

karma init throwing error on Windows

See original GitHub issue

Expected behavior

We should expect to get some sort of init just like karma-cli…which is also broke on Windows

Actual behavior

`$ karma init

readline.js:526 this.line = this.line.slice(this.cursor); ^

TypeError: Cannot read property ‘slice’ of undefined at Interface._deleteLineLeft (readline.js:526:24) at suggestNextOption (C:\dev\R22788\web-app\web\node_modules\karma\lib\init\state_machine.js:43:9) at nextQuestion (C:\dev\R22788\web-app\web\node_modules\karma\lib\init\state_machine.js:119:12) at process (C:\dev\R22788\web-app\web\node_modules\karma\lib\init\state_machine.js:135:10) at Object.exports.init (C:\dev\R22788\web-app\web\node_modules\karma\lib\init.js:247:6) at Object.exports.run (C:\dev\R22788\web-app\web\node_modules\karma\lib\cli.js:249:25) at requireCliAndRun (C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:44:16) at C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:54:12 at C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:44:21 at ondir (C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:187:31) at C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:153:39 at onex (C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:93:22) at C:\Users\ufen\AppData\Roaming\npm\node_modules\karma-cli\node_modules\resolve\lib\async.js:24:18 at FSReqWrap.oncomplete (fs.js:82:15) `

Enviroment Details

  • Windows 7 Enterprise
  • node version 5.9
  • Karma version (output of karma --version): 0.13.22

Steps to reproduce the behaviour

  1. run karma init from node_modules

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

12reactions
malkomichcommented, Sep 7, 2016

Probably you’re using the Git Bash terminal, MinTTY, which doesn’t have full support for TTY.

You have 4 options to fix the problem:

  1. Use CMD terminal with the Windows shell (the default Windows console)
  2. Use CMD terminal with the Bash shell (execute "C:\Program Files\Git\bin\bash.exe" --login -i in cmd terminal)
  3. Use Powershell (an alternative terminal typically installed by default in Windows environments)
  4. Use an alternative terminal (or develop a new one 😜 )

If you just need execute isolated interactive commands like karma init, I recommend option 1 for it and then come back to Git Bash. However I would give a try to Powershell.

0reactions
cfangxxcommented, Sep 11, 2017

succeed in using cmd

Read more comments on GitHub >

github_iconTop Results From Across the Web

karma init error on windows · Issue #18 - GitHub
Got this error when running karma init Karma cli version 0.13.16 Clean install of node with jasmine and karma npm packages readline.js:525 ...
Read more >
npm - karma-init fails on Windows 10 with Node.js 7.1.0 x64 - Stack ...
I get the following error when executing karma-init : C:\Projects\SocialMeal>karma init events.js:160 throw er; // Unhandled 'error' event ^ Error: write ...
Read more >
Troubleshooting - Karma test runner
I'm getting a weird error from the browser, how can I debug it? # ... Go to the captured browser and click the...
Read more >
Karma start throws spawn ENOENT error - Google Groups
This is on a Windows machine, but I am trying to use Testacular/Karma. I installed node, got jasmine and karma via NPM and...
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found