Error in config file : Cannot find module 'angular-cli/plugins/karma'
See original GitHub issuePlease provide us with the following information:
OS?
Windows 10 x64
Versions.
Please run
ng --version. If there’s nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.18 node: 6.4.0
Repro steps.
Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
Created the app usin the CLI (updated yesterday to the latest version). The app works and loads in Chrome. For now there’s just an input field. I created a service using “ng g myservice” Then I wrote some tests in myservice.service.ts I ran “ng test”
The log given by the failure.
Normally this include a stack trace and some more information.
$ ng test --watch=false 22 10 2016 11:05:54.156:ERROR [config]: Error in config file! { Error: Cannot find module ‘angular-cli/plugins/karma’ at Function.Module._resolveFilename (module.js:455:15) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at module.exports (D:\dev\wiki_a2\karma.conf.js:12:7) at Object.parseConfig (D:\dev\wiki_a2\node_modules\karma\lib\config.js:377:5) at new Server (D:\dev\wiki_a2\node_modules\karma\lib\server.js:56:20) at C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\tasks\test.js:25:31 at Class.exports.default.Task.extend.run (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\tasks\test.js:15:16) at Class.TestCommand.extend.run (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\commands\test.js:26:25) at Class.<anonymous> (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\models\command.js:152:17) at tryCatch (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\node_modules\rsvp\dist\lib\rsvp-internal.js:215:12) at invokeCallback (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\node_modules\rsvp\dist\lib\rsvp-internal.js:230:13)
at C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\node_modules\rsvp\dist\lib\rsvp\then.js:29:16
at flush (C:\Users\Elg\AppData\Roaming\npm\node_modules\angular-cli\node_modules\rsvp\dist\lib\rsvp\asap.js:85:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9) code: 'MODULE_NOT_FOUND' }
Mention any other details that might be useful.
Thanks! We’ll be in touch soon.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:18 (2 by maintainers)
Top Related StackOverflow Question
Hi, When I updated from angular-cli to @angular/cli, i also faced the same issue:
Error: Cannot find module 'angular-cli/plugins/karma'The solution worked for me is to update the karma.conf.js file present in root folder of the project.
After this change, ng test should work.
Check if angular-cli/plugins/karma exists in the node_modules directory.
In my case the problem was that I had migrated to @angular/cli package, but karma.conf.js was still referencing the angular-cli paths. I updated my references by comparing to the karma.conf.js from this repo: https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/blueprints/ng2/files/karma.conf.js