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

Cannot find module 'chai' immediately after setup #48

Closed
jbcpollak opened this issue Oct 15, 2015 · 1 comment
Closed

Cannot find module 'chai' immediately after setup #48

jbcpollak opened this issue Oct 15, 2015 · 1 comment

Comments

@jbcpollak
Copy link

I followed the setup instructions (clone then npm install), and when I run gulp, everything starts fine. But if I run npm test, I get this error:

module.js:338
    throw err;
    ^

Error: Cannot find module 'chai'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.require.resolve (module.js:388:19)

I see karma-chai is a dependency, and it is installed in node_modules.

I am using node v4.1.2 and npm 3.3.6.

@fesor
Copy link
Collaborator

fesor commented Nov 1, 2015

The reason is that chai module listed in karma-chai as peer dependency.

With NPM3 you'll get this warnings:

npm WARN peerDependencies The peer dependency chai@* included from karma-chai will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

So what you need to do is just install chai locally for your project:

npm install --save chai

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

2 participants