I was started to read "Developing an AngularJS Edge", and I wanted to set up the various frameworks in use.
The book uses nodejs and karma, along with several other frameworks.
I'm on Win7x32.
I just upgraded my nodejs to the latest, v0.10.18 .
I installed the Karma package with "npm install -g karma". This appeared to complete successfully.
I then ran "karma init", which did this:
% karma init
>
readline.js:507
this.line = this.line.slice(this.cursor);
^
TypeError: Cannot call method 'slice' of undefined
at Interface._deleteLineLeft (readline.js:507:25)
at suggestNextOption (C:\Users\David\AppData\Roaming\npm\node_modules\karma\lib\init.js:167:9)
at nextQuestion (C:\Users\David\AppData\Roaming\npm\node_modules\karma\lib\init.js:235:12)
at process (C:\Users\David\AppData\Roaming\npm\node_modules\karma\lib\init.js:250:10)
at Object.exports.init (C:\Users\David\AppData\Roaming\npm\node_modules\karma\lib\init.js:352:6)
at Object.<anonymous> (C:\Users\David\AppData\Roaming\npm\node_modules\karma\bin\karma:25:37)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Note that this error is virtually identical to the stack trace reported by this person a month ago, but that report has received no response.
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:
"C:\Program Files\Git\bin\bash.exe" --login -i
in cmd terminal)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.
The reason for the error with running npm in Cygwin seems to be a known issue with npm. You can use the work around mentioned here,
https://stackoverflow.com/a/22436199/2390020
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With