node-talib icon indicating copy to clipboard operation
node-talib copied to clipboard

Support for node v16

Open grantweii opened this issue 2 years ago • 7 comments

Install fails on node v16.0.0. Downgrading to v14 worked. Can you please update to support node 16? Using M1 Mac. Thank you!

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/talib/src/talib.o
In file included from ../src/talib.cpp:28:
In file included from /Users/<user>/Library/Caches/node-gyp/16.0.0/include/node/node.h:63:
In file included from /Users/<user>/Library/Caches/node-gyp/16.0.0/include/node/v8.h:30:
/Users/<user>/Library/Caches/node-gyp/16.0.0/include/node/v8-internal.h:452:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
            !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                ~~~~~^~~~~~~~~~~
                                     remove_cv
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:715:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
../src/talib.cpp:85:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(1, argv);
              ^
../../nan/nan.h:1743:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:108:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/talib.cpp:95:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(1, argv);
              ^
../../nan/nan.h:1743:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:108:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/talib.cpp:546:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(2, argv);
              ^
../../nan/nan.h:1743:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:108:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
3 warnings and 1 error generated.
make: *** [Release/obj.target/talib/src/talib.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/<user>/.nvm/versions/node/v16.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 21.4.0
gyp ERR! command "/Users/<user>/.nvm/versions/node/v16.0.0/bin/node" "/Users/<user>/.nvm/versions/node/v16.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"

grantweii avatar Apr 05 '22 02:04 grantweii

I think it is time to rewrite with a better parallelization and more of better JS conventions.

oransel avatar Apr 07 '22 15:04 oransel

Is there any workaround for this?

chiragpurohit71085 avatar Aug 31 '22 12:08 chiragpurohit71085

Following worked for me with v16.15.0 export CXXFLAGS="--std=c++17" && npm install

chiragpurohit71085 avatar Aug 31 '22 12:08 chiragpurohit71085

Updates to my previous post, The solution I posted works for ec2 instance (or where we have access to terminal), but now I have to deploy on environment where I do not have access...

How we can build this lib for node V16.X , as I have to deploy this on Lambda function with V16.x. I am happy to contribute on this.

chiragpurohit71085 avatar Sep 26 '22 06:09 chiragpurohit71085

Are we open to breaking changes? or backwards compatibility is important?

oransel avatar Sep 26 '22 16:09 oransel

Hi I am open to breaking changes, backwards compatibility i.e support for earlier version of nodejs is not required.

chiragpurohit71085 avatar Sep 27 '22 01:09 chiragpurohit71085

Sounds good. Quickest will be to keep to the current spec, but I'll see when I can find time to make the changes for v16.x+

oransel avatar Sep 27 '22 14:09 oransel

would be great to get it working on node 16 and even 18..

it worked on 14 but soon some hosting services and other packages will drop support for 14 and that will become a big issue :(

hems avatar Dec 17 '22 23:12 hems

Yes, one of these days, I will set some time a side and redo this library. Donations are welcome.

oransel avatar Dec 19 '22 15:12 oransel

@oransel unfortunatley node 16 is the minimum for my program for other deps ! now talib library broke and totally stuck ! .. would greatly appreciate it if you build for v16 or let us know what is involved on this upgrade ! awesome work and thank you

nileio avatar Dec 21 '22 06:12 nileio

Yes, one of these days, I will set some time a side and redo this library. Donations are welcome.

If you could kindly add information on the README file on how to solve this sort of issue maybe other devs could contribute / help?

That would be ace 🚀

hems avatar Dec 26 '22 03:12 hems

Try the latest version and let me know if this helps

oransel avatar Dec 29 '22 00:12 oransel