karma-runner / karma-runner/karma

karma初始化错误

Open
#2,290 3 comments 0 reactions 0 assignees View on GitHub
needs: feedback-from-author
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behavior

执行 `karma init` 应该可以正常初始化生成相应的配置文件,但是在我的win10操作系统上运行不正常。
### Actual behavior

具体报错信息如下

```
$ ./node_modules/.bin/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 (D:\website\FED\sparrow\node_modules\karma\lib\init\state_ machine.js:43:9)
at nextQuestion (D:\website\FED\sparrow\node_modules\karma\lib\init\state_machi ne.js:119:12)
at process (D:\website\FED\sparrow\node_modules\karma\lib\init\state_machine.js :135:10)
at Object.exports.init (D:\website\FED\sparrow\node_modules\karma\lib\init.js:2 38:6)
at Object.exports.run (D:\website\FED\sparrow\node_modules\karma\lib\cli.js:271 :25)
at Object. (D:\website\FED\sparrow\node_modules\karma\bin\karma:3:23 )
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

```
### Enviroment Details
- Karma version (output of `karma --version`):

```
$ ./node_modules/.bin/karma --version
Karma version: 1.1.2

```
- Relevant part of your `karma.config.js` file
none
### Steps to reproduce the behaviour

1.`npm install --save-dev karma karma-chrome-launcher mocha karma-mocha chai`
2.`./node_moduels/.bin/karma init`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.