node.js 返回 process.dlopen(module, path._makeLong(filename));

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35568243/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 19:57:43  来源:igfitidea点击:

return process.dlopen(module, path._makeLong(filename));

node.jsopencv

提问by Saurav kumar

I am getting this error when running an example from OpenCV Node

从 OpenCV 节点运行示例时出现此错误

  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /home/sunny/face/build/opencv/v5.0.0/Release/node-v46-linux-x64/opencv.node: undefined symbol: _ZNK2cv9Algorithm5writeERNS_11FileStorageE
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object. (/home/sunny/face/lib/bindings.js:4:15)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)

采纳答案by Amol Barshile

Use this command, it works fine:

使用这个命令,它工作正常:

npm rebuild bcrypt --build-from-source

回答by ojrask

Try refreshing your installed modules by

尝试通过以下方式刷新已安装的模块

$ rm -rf node_modules/
$ npm update

I got errors relating to process.dlopenwhen using Gulp and node-sass. Clearing the installed modules fixed the issue for me.

process.dlopen在使用 Gulp 和 node-sass 时遇到了错误。清除已安装的模块为我解决了这个问题。

EDIT: Not certain how OpenCV works (or what it actually is), but I presume it handles NodeJS modules similarly to regular NodeJS applications, where you can refresh the module collection.

编辑:不确定 OpenCV 是如何工作的(或它实际上是什么),但我认为它处理 NodeJS 模块的方式类似于常规 NodeJS 应用程序,您可以在其中刷新模块集合。

回答by mscdex

You should check your OpenCV installation, it's probably either missing/can't be found or its not a version supported by the OpenCV node binding. Assuming you're using the opencvmodule on npm, its readme says that OpenCV versions from v2.3.1 until v3.0.0 are (fully) supported.

您应该检查您的 OpenCV 安装,它可能丢失/无法找到,或者它不是 OpenCV 节点绑定支持的版本。假设你opencv在 npm 上使用这个模块,它的自述文件说从 v2.3.1 到 v3.0.0 的 OpenCV 版本是(完全)支持的。

回答by Black Mamba

I ran these commands but to no success

我运行了这些命令但没有成功

$ rm -rf node_modules/
$ npm update

The only thing that helped me was

唯一帮助我的是

yarn add node-sass

Finally my node modules were installed successfully.

最后我的节点模块安装成功。

回答by vanduc1102

My case, I have the node_moduleson my .dockerignore

我的情况,我有node_modules我的.dockerignore

node_modules
upload
export
converage
.git
.tmp
.vscode
.github
.env

But I still have to make docker-composebe able to ignore the node_modulesfolder.

但我仍然必须docker-compose能够忽略该node_modules文件夹。

services:
  api:
    build: .
    command: npm run dev
    volumes:
      - '.:/usr/src/app'
      - /usr/src/app/node_modules/
    ports:
      - "3000:3000"

I think docker-composewill skip copy node_moduleswhich is built for MacOS into Linux container.

我认为docker-compose将跳过node_modules为 MacOS 构建的副本到 Linux 容器中。

Add a volume to Docker, but exclude a sub-folder

向 Docker 添加卷,但排除子文件夹