Cannot find module dtrace-provider

Ernani picture Ernani · May 31, 2016 · Viewed 11.5k times · Source

I have a simple nodejs application that is throwing "Cannot find module './build/Release/DTraceProviderBindings'". I look it up online and it looks like that a lot of people are having the same problem when using restify on windows (which is my case, I'm using restify on windows 10). Apparently, dtrace-provider is a optional module for restify and there is no version of it for windows. So, what I tried so far:

  1. Update node to v6.2.0;
  2. Uninstall all modules and run npm install --no-optional;
  3. Uninstall only restify and run npm install restify --no-optional;
  4. And my most desperate move npm install dtrace-provider.

Everything I tried where found on github issues, I've seen same error on OSX users with other modules. Not sure what else to try.

Note: This exception does not stop my application, not even prints the error on the console, I just notice that this was happening using the debugger, in other words, my application runs fine, but this keeps happening on the background.

List of other modules I'm using:

"dependencies": {
    "restify": "latest",
    "request":  ">=2.11.1",
    "cheerio":  ">=0.10.0",
    "xml2js":   ">=0.2.0",
    "botbuilder": "^0.11.1",
    "applicationinsights": "latest"
  }

Answer

Steve Hynding picture Steve Hynding · Aug 3, 2016

This worked for me after switching to Node 6.1 (and when re-installing node modules didn't work):

  1. Install and save dtrace-provider

    $ npm install dtrace-provider --save
    
  2. Delete 'node_modules' folder

  3. Re-install node modules

    $ npm install
    

I found this thread before combining your attempts with another solution on the Github project issues for restify (https://github.com/restify/node-restify/issues/1093) and simplified best as possible.