51Degrees / Device-Detection

THE Fastest and most Accurate device detection for C / PHP / Perl / Python and Node.js - professionally maintained device data
https://51degrees.com/device-detection
Other
112 stars 46 forks source link

Node v12 Version Support #36

Closed bmalum closed 5 years ago

bmalum commented 5 years ago

Hi,

We are currently lifting the NodeJS Version in our infrastructure to NodeJS v12. We noticed that fiftyonedegreescore has a node versionCheck.js. So every npm install with a version >= v10.0.0 will be aborted with an error. Installing without the versionCheck results in this error:

node.js git:(master) ✗ npm install fiftyonedegreescore/

> fiftyonedegreescore@3.2.23 preinstall /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/node_modules/fiftyonedegreescore
> node versionCheck.js

12.5

> fiftyonedegreescore@3.2.23 install /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/node_modules/fiftyonedegreescore
> node-gyp configure && node-gyp build

  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees.o
../src/pattern/51Degrees.c:1469:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
static const int32_t getSignatureNodeOffsetsCount(const fiftyoneDegreesDataSet *dataSet, const byte *signature) {
       ^~~~~~
../src/pattern/51Degrees.c:1507:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
static const int32_t getRankFromSignature(const fiftyoneDegreesDataSet *dataSet, const byte *signature) {
       ^~~~~~
../src/pattern/51Degrees.c:3170:12: warning: unused function 'resultsetCacheValidate' [-Wunused-function]
static int resultsetCacheValidate(const fiftyoneDegreesResultsetCache *cache) {
           ^
3 warnings generated.
  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/cityhash/city.o
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Provider.o
../src/pattern/Provider.cpp:200:3: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
                delete properties;
                ^
                      []
../src/pattern/Provider.cpp:187:28: note: allocated with 'new[]' here
        const char **properties = new const char*[propertiesArray.size()];
                                  ^
1 warning generated.
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Match.o
../src/pattern/Match.cpp:145:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
    delete buffer;
    ^
          []
../src/pattern/Match.cpp:139:20: note: allocated with 'new[]' here
    char *buffer = new char[ws->dataSet->header.maxUserAgentLength];
                   ^
../src/pattern/Match.cpp:160:5: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
    delete buffer;
    ^
          []
../src/pattern/Match.cpp:157:20: note: allocated with 'new[]' here
    char *buffer = new char[bufferSize];
                   ^
2 warnings generated.
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/Profiles.o
  CC(target) Release/obj.target/FiftyOneDegreesPatternV3/src/threading.o
  CXX(target) Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees_node.o
../src/pattern/51Degrees_node.cpp:874:47: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
  SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg)));
                                              ^
../src/pattern/51Degrees_node.cpp:823:44: note: expanded from macro 'SWIGV8_STRING_NEW'
#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:909:7: error: no template named 'Handle' in namespace 'v8'
  v8::Handle<v8::Value> err;
  ~~~~^
../src/pattern/51Degrees_node.cpp:904:32: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    err = v8::Exception::Error(SWIGV8_STRING_NEW(msg));
                               ^
../src/pattern/51Degrees_node.cpp:823:44: note: expanded from macro 'SWIGV8_STRING_NEW'
#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:974:65: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                      ~~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:974:48: error: no member named 'Handle' in namespace 'v8'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                           ~~~~^
../src/pattern/51Degrees_node.cpp:974:67: error: use of undeclared identifier 'objRef'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                  ^
../src/pattern/51Degrees_node.cpp:974:80: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                          ~~~~ ^
../src/pattern/51Degrees_node.cpp:974:82: error: use of undeclared identifier 'ptr'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                 ^
../src/pattern/51Degrees_node.cpp:974:87: error: unexpected type name 'swig_type_info': expected expression
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                      ^
../src/pattern/51Degrees_node.cpp:974:103: error: use of undeclared identifier 'info'
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                      ^
../src/pattern/51Degrees_node.cpp:974:113: error: expected '(' for function-style cast or type construction
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                            ~~~ ^
../src/pattern/51Degrees_node.cpp:974:119: error: expected ';' after top level declarator
SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) {
                                                                                                                      ^
                                                                                                                      ;
../src/pattern/51Degrees_node.cpp:1247:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
SWIGRUNTIMEINLINE
^
../src/pattern/51Degrees_node.cpp:214:40: note: expanded from macro 'SWIGRUNTIMEINLINE'
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
                                       ^
../src/pattern/51Degrees_node.cpp:55:23: note: expanded from macro 'SWIGINLINE'
#   define SWIGINLINE inline
                      ^
../src/pattern/51Degrees_node.cpp:1248:44: error: expected '(' for function-style cast or type construction
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                  ~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:1248:28: error: no member named 'Handle' in namespace 'v8'
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                       ~~~~^
../src/pattern/51Degrees_node.cpp:1248:46: error: use of undeclared identifier 'valRef'
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                             ^
../src/pattern/51Degrees_node.cpp:1248:53: error: expected ';' after top level declarator
int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
                                                    ^
                                                    ;
../src/pattern/51Degrees_node.cpp:1443:17: error: no template named 'Handle' in namespace 'v8'
SWIGRUNTIME v8::Handle<v8::FunctionTemplate> SWIGV8_CreateClassTemplate(const char* symbol) {
            ~~~~^
../src/pattern/51Degrees_node.cpp:1447:31: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol));
                              ^
../src/pattern/51Degrees_node.cpp:824:44: note: expanded from macro 'SWIGV8_SYMBOL_NEW'
#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym)
                                           ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/martin.karrer/.node-gyp/12.5.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pattern/51Degrees_node.cpp:1449:34: error: expected '(' for function-style cast or type construction
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
               ~~~~~~~~~~~~~~~~~~^
../src/pattern/51Degrees_node.cpp:1449:9: error: no member named 'Handle' in namespace 'v8'
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
    ~~~~^
../src/pattern/51Degrees_node.cpp:1449:36: error: use of undeclared identifier 'inst_templ'; did you mean 'class_templ'?
    v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate();
                                   ^~~~~~~~~~
                                   class_templ
../src/pattern/51Degrees_node.cpp:1446:37: note: 'class_templ' declared here
    v8::Local<v8::FunctionTemplate> class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID();
                                    ^
../src/pattern/51Degrees_node.cpp:1450:5: error: use of undeclared identifier 'inst_templ'
    inst_templ->SetInternalFieldCount(1);
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
make: *** [Release/obj.target/FiftyOneDegreesPatternV3/src/pattern/51Degrees_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/fiftyonedegreescore
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/martin.karrer/Documents/Development/devicedetection/Device-Detection/node.js/package.json'
npm WARN node.js No description
npm WARN node.js No repository field.
npm WARN node.js No README data
npm WARN node.js No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fiftyonedegreescore@3.2.23 install: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fiftyonedegreescore@3.2.23 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/martin.karrer/.npm/_logs/2019-07-08T17_18_42_777Z-debug.log

Current System: 19.0.0 Darwin Kernel Version 19.0.0: Thu Jun 13 21:52:56 PDT 2019; root:xnu-6110.0.0.121.5~2/RELEASE_X86_64 x86_64 same on 4.4.0-1069-aws #79-Ubuntu SMP Mon Sep 24 15:01:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Is there any ETA for NodeJS v12.x.x Support?

JoshGrew51D commented 5 years ago

Hi There

Some of the functionality available within Nodes V8 engine had been deprecated and subsequently removed with Version 12.

Changes to resolve this are currently in testing. If all goes as planned, we will be releasing an update in the next couple of weeks.

JoshGrew51D commented 5 years ago

I have pushed an additional branch that supports v12. We will be working on adding this to master once we are confident the swig changes have been finalized.

Any issues let me know.

JoshGrew51D commented 5 years ago

Closing issue for the time being. If you get any issues just let me know.