找不到模块 dtrace-provider [英] Cannot find module dtrace-provider
问题描述
我有一个简单的 nodejs 应用程序,它抛出 找不到模块 './build/Release/DTraceProviderBindings'"
.我在网上查了一下,好像很多人在 windows 上使用 restify 时都遇到了同样的问题(这是我的情况,我在 windows 10 上使用 restify).显然,dtrace-provider 是 restify 的一个可选模块,并且没有它用于窗户.所以,到目前为止我尝试过的:
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:
- 将节点更新到 v6.2.0;
- 卸载所有模块并运行
npm install --no-optional
; - 只卸载restify并运行
npm install restify --no-optional
; - 还有我最绝望的一步 npm install
dtrace-provider
.
我在 github 问题上尝试过的所有方法,我都在 OSX 用户使用其他模块时看到了同样的错误.不知道还能尝试什么.
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"
}
推荐答案
这在切换到 Node 6.1 后对我有用(并且当重新安装节点模块不起作用时):
This worked for me after switching to Node 6.1 (and when re-installing node modules didn't work):
安装并保存 dtrace-provider
Install and save dtrace-provider
$ npm install dtrace-provider --save
删除node_modules"文件夹
Delete 'node_modules' folder
重新安装节点模块
$ npm install
在将您的尝试与关于 restify 的 Github 项目问题的另一个解决方案相结合之前,我发现了这个线程(https://github.com/restify/node-restify/issues/1093) 并尽可能简化.
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.
这篇关于找不到模块 dtrace-provider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!