Opencv4nodejs: 5.3.0 fail npm i on mac os x

Created on 24 Sep 2019  路  13Comments  路  Source: justadudewhohacks/opencv4nodejs

npm i opencv4nodejs

ERR! RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded

this error come on the version [email protected]

I use Mac OS X (Majove Version 10.14.3)

the version 5.2.0 working fine

bug

Most helpful comment

Failed to find that exec call on my own, thank you! Increasing maxBuffer to 1024^3 fixed the issue for me. It is indeed likely that compilation on arch produces more warnings than usually since they often update gcc, which in turn often rolls out new warnings. It is hard to say what the appropriate maxBuffer value could be - it's different for every environment. For me stderr and stdout lengths where 3070605 and 7635 respectively.
The current workaround for me, that doesn't require modifying the source code, is CFLAGS="-w" CXXFLAGS="-w" npm install opencv4nodejs. This forces cmake to pass -w to gcc, which suppresses most of the warnings.

All 13 comments

I am having same issue but installing on a RPI. How do i build with previous opencv4nodejs version? I successfully installed opencv4nodejs on raspberry pi last month but not working now.

juste do

npm i [email protected]

Thanks man. What could have happened between 5.2 and 5.3 that crashes the memory with this build?

I do not really know, the error handling buffer is exceeded. Like we see a lot of warning at the compilation and he can't print everything in the buffer.

hey guys, do you have the error Error: Cannot find module /node_modules/opencv4nodejs/build/Release/opencv4nodejs' ? I dont know why i got it.... Getting crazy when i launched the program. Im using Mac OS

Here is my settings for installing this [email protected] library

$ nvm ls
        v9.11.2
       v10.16.3
->      v12.9.0

$ export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
$ npm i opencv4nodejs                     

I've used almost 2h just for installing this one but the key was
export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
before installing nor the npm version, node version etc.

Hope this could help someone struggling like me ;)

Any idea? i'm stuck too :(
Mac mojave version 10.14.6

tr_emplace' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4710:29: note: in instantiation of function template specialization 'std::__1::shared_ptr::make_shared<>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
/usr/local/Cellar/node/12.10.0/lib/node_modules/opencv4nodejs/node_modules/native-node-utils/src/ObjectWrap.h:59:23: note: in instantiation of function template specialization 'std::__1::make_shared' requested here
auto worker = std::make_shared();
^
../cc/core/Mat.cc:758:7: note: in instantiation of function template specialization 'FF::ObjectWrapTemplate::syncBinding' requested here
Mat::syncBinding("Solve", info);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3710:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
2 warnings generated.
In file included from ../cc/core/Rect.cc:1:
In file included from ../cc/core/Rect.h:1:
In file included from /usr/local/include/opencv4/opencv2/core.hpp:52:
In file included from /usr/local/include/opencv4/opencv2/core/cvdef.h:695:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/array:112:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:644:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3710:5: warning: ERR! RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded

Same problem with RPi 3, Linux 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l
npm -v 6.9.0
node -v v10.16.3
cmake version 3.13.4

previous version installed without problems ---- npm i [email protected]

But now the application is crashing often from segmentation fualt.

*Edit - Im using armv6 with Rpi zero

Same issue arch linux, npm 6.12.0, node 12.13.0, cmake 3.15.4.

Probably have to increase the maxBuffer option for the gyp processes stdout buffer, since the install script spawns a gyp process from node rather then directly from npm since 5.3.0:
https://github.com/justadudewhohacks/opencv4nodejs/blob/master/install/install.js#L83-L86

Not sure why this error occurs for you but does not for any of the CI tasks, probably due to your environment a lot of warnings are generated when compiling the module. Anyways I think this solution should fix it. Will get a fix pushed this weekend.

Failed to find that exec call on my own, thank you! Increasing maxBuffer to 1024^3 fixed the issue for me. It is indeed likely that compilation on arch produces more warnings than usually since they often update gcc, which in turn often rolls out new warnings. It is hard to say what the appropriate maxBuffer value could be - it's different for every environment. For me stderr and stdout lengths where 3070605 and 7635 respectively.
The current workaround for me, that doesn't require modifying the source code, is CFLAGS="-w" CXXFLAGS="-w" npm install opencv4nodejs. This forces cmake to pass -w to gcc, which suppresses most of the warnings.

This issue is fixed with 5.5.0. Please let me know, if you are still facing this error for some reason.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShadabFaiz picture ShadabFaiz  路  7Comments

je3f0o picture je3f0o  路  6Comments

ryandons picture ryandons  路  4Comments

G33kLabs picture G33kLabs  路  3Comments

developer239 picture developer239  路  5Comments