Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'chai' #17

Open
miparnisari opened this issue Dec 21, 2016 · 2 comments
Open

Error: Cannot find module 'chai' #17

miparnisari opened this issue Dec 21, 2016 · 2 comments

Comments

@miparnisari
Copy link

miparnisari commented Dec 21, 2016

I followed the installation steps and this is my karma.conf.js:

module.exports = function (config) {
  config.set({
    basePath: process.cwd(),
    frameworks: ['mocha', 'chai'],
    files: [
      'bower_components/angular/angular.js',
      'bower_components/angular-mocks/angular-mocks.js',
      'bower_components/angular-resource/angular-resource.js',
      // shortened for brevity
      { pattern: 'app/**/*.js', included: true, nocache: true, watched: false },
      { pattern: 'test/spec/**/*.js', included: true, nocache: true, watched: false }],
    exclude: [],
    preprocessors: {},
    port: 9876,
    colors: true,
    logLevel: config.LOG_DEBUG,
    autoWatch: false,
    browsers: ['Chrome'],
    singleRun: true,
    concurrency: Infinity
  });
};

When I run karma I get this:

λ gulp test                                                                                
[12:30:29] Using gulpfile ~\Desktop\project\frontend\gulpfile.js                            
[12:30:29] Starting 'start:server:test'...                                                 
[12:30:29] Finished 'start:server:test' after 149 ms                                       
[12:30:29] Starting 'test'...                                                              
21 12 2016 12:30:29.294:DEBUG [plugin]: Loading karma-* from C:\Users\miparnisari\project\frontend\node_modules                                                                
21 12 2016 12:30:29.294:DEBUG [plugin]: Loading plugin C:\Users\miparnisari\Desktop\project\
frontend\node_modules/karma-chai.                                                          
21 12 2016 12:30:29.294:DEBUG [plugin]: Loading plugin C:\Users\miparnisari\Desktop\project\
frontend\node_modules/karma-chrome-launcher.                                               
21 12 2016 12:30:29.294:DEBUG [plugin]: Loading plugin C:\Users\miparnisari\Desktop\project\
frontend\node_modules/karma-mocha.                                                         
21 12 2016 12:30:29.310:DEBUG [plugin]: Loading plugin C:\Users\miparnisari\Desktop\project\
frontend\node_modules/karma-phantomjs-launcher.                                            
21 12 2016 12:30:29.310:DEBUG [plugin]: Loading plugin C:\Users\miparnisari\Desktop\project\
frontend\node_modules/karma-requirejs.                                                     
[12:30:29] 'test' errored after 48 ms                                                      
[12:30:29] Error: Cannot find module 'chai'                                                
    at Function.Module._resolveFilename (module.js:325:15)                                 
    at Function.require.resolve (internal/module.js:16:19)                                 
@blabno
Copy link

blabno commented Sep 21, 2017

Your npm did not install chai.

npm i -DE chai

@luckylooke
Copy link

@blabno I would expect this step to be mentioned in https://github.com/xdissent/karma-chai#installation, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants