Context: if you use a node module having
dtrace-provider as one of its dependencies, even primary or optional, once in a while you may notice a peculiar error spit out from your node processes:
Error: Cannot find module './build/Debug/DTraceProviderBindings'
This usually happens when I upgrade my Node.js version then go back to maintaining a few week old codebase.
Top-of-mind solutions are
npm rebuild or remove
node_modules then re-install all npm modules. Somehow those don’t work for me in the case of
Instead, what works for me is:
Bonus: sometimes I notice
node-gyp is *gone*. Nada. Nothing. And of course without me messing anything with neither global nor local npm directories. In those cases, I either re-install
node-gyp or try to run the above commands under verbose mode to see where
node-gyp fails me, then patch things manually.
I attribute all these weird issues to my using a mix of
homebrew node and
homebrew nvm, so you may not experience anything like this if your setup is different from mine. But in case you do, hope this helps!