mfncooper / mockery

Simplifying the use of mocks with Node.js
Other
1.1k stars 60 forks source link

Error: Module did not self register #45

Closed nerdpad closed 8 years ago

nerdpad commented 8 years ago

I get the following error, when mockery is enabled:

mockery.enable({
            warnOnReplace: false,
            warnOnUnregistered: false,
            useCleanCache: true
        });
[Error: Module did not self-register.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

My test cases work fine. How do I get rid of these errors?

nerdpad commented 8 years ago

@davglass I am using v1.6.2, and I am still getting the same error. Do I need to change anything in my code for this?

nerdpad commented 8 years ago

Respectful bump.

I am still getting the same errors console. I am using v1.6.2.

Is there a ways to just suppress these? If there is no way to fix them?

davglass commented 8 years ago

What version of Node are you using? Those error strings are from Node and not from Mockery AFAIK.

nerdpad commented 8 years ago

I m using v5.6.0

davglass commented 8 years ago

Thanks, I'll see if I can replicate this. I've seen this error in node 4.x+ but I'm unsure where it's coming from and how to fix it.

nerdpad commented 8 years ago

It only comes when I have useCleanCache: true

davglass commented 8 years ago

@NerdPad Just pushed up mockery@1.7.0 which should fix your issue. Let me know if it doesn't.

nerdpad commented 8 years ago

Will verify. Thanks for the quick response. On May 6, 2016 4:36 PM, "Dav Glass" notifications@github.com wrote:

@NerdPad https://github.com/NerdPad Just pushed up mockery@1.7.0 which should fix your issue. Let me know if it doesn't.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/mfncooper/mockery/issues/45#issuecomment-217552249

nerdpad commented 8 years ago

@davglass I can confirm that this update did fix the issue. Thank you.

davglass commented 8 years ago

Awesome, thanks goes to @bengl for the fix 🍻

rupamroy commented 7 years ago

I am again getting the same error

mockery version 1.7.0 , 2.0.0 node version 6.1.0