karma init throwing error on Windows

Created on 7 Apr 2016  路  7Comments  路  Source: karma-runner/karma

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

Most helpful comment

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 :stuck_out_tongue_winking_eye: )

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.

All 7 comments

I have the same problem.

I'm having the same issue on Windows 10.
Node 5.1.1
Karma 0.13.22

Same issue here.

Identical setup as the previous user on Windows 10. Using Node 5.1.1 and Karma 0.13.22

The error only shows up when using Mingw-w64 (git bash).

Works fine on cmd.exe.

Same error.

  • Windows 10 x64
  • Node 6.1.0

Works only in cmd. Not working in git-bash or webstorm terminal.

I'm having the same issue
Windows 7

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 :stuck_out_tongue_winking_eye: )

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.

succeed in using cmd

Was this page helpful?
0 / 5 - 0 ratings