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:
- Update node to v6.2.0;
- Uninstall all modules and run
npm install --no-optional
; - Uninstall only restify and run
npm install restify --no-optional
; - 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"
}
This worked for me after switching to Node 6.1 (and when re-installing node modules didn't work):
Install and save dtrace-provider
Delete 'node_modules' folder
Re-install node modules
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.
I recently ran into this error as well on node v8.8.1 as @Derek mentioned, I ran
npm rebuild dtrace-provider
and that resolved the problem.tl;dr; dtrace-provider utilized node-gyp which required python version >= 2.5 and NOT 3.5
I had this issue on OSX and found a post that showed using environment variable
V=/Users/your_user/your_project npm i dtrace-provider
This let me know that there was a dependency on
node-gyp
that was failing to build...Once I knew the issue was with this module was able to focus my attention at troubleshootingnode-gyp
.This led to some log output indicating that my python version
3.5
was unsupported and it required version>= 2.5
.Went and downloaded python
2.7.x
and checked/usr/bin/python 2.7.x
to ensure it was there. Uninstalled the node module that was ultimately requiring this module, then usednpm cache clean
then reinstalled the module and this time it appeared to pick up the right python version to be able to build.Hope this helps someone =)
I have tried many suggestions but get the same error again.
Finally, I found the correct way to solve this question.
Go the node.js website and download the latest version of node.js pkg.
After installed, reinstall your software, everything will be ok.
The restify team followed an approach of trying to load the module by requiring it on a try/catch block. You should just ignore the exception.
I know this is an old issue but I wanted to comment on it in case anyone else has the same issue I had.
My issue was caused by having parentheses in my path.
/users/karlgroves/Dropbox (Personal)/foo/bar/bat/project...
Moving the project to a path without the parens worked for me. You'll need to wipe out
node_modules
and reinstall again.