chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
320 stars 68 forks source link

dtrace-provide module error when using latest node version #111

Closed senthil5053 closed 6 years ago

senthil5053 commented 6 years ago

I'm using node v8.9.4, npm v5.6.0. After updating node version from v6.11.4 to v8.9.4 I get the following error:


was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:672:18)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/dtrace-provider/dtrace-provider.js:18:23)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
Error: The module '/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:672:18)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3) code: 'MODULE_NOT_FOUND' }```

Can someone help here to resolve this ?
melloc commented 6 years ago

@senthil5053 The module was built against the older version of node:

Error: The module '/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

You'll want to run npm rebuild or delete your node_modules directory and run npm install to build against the right version of node.

senthil5053 commented 6 years ago

@melloc Thanks for the response. Yeah, I did try npm rebuild after removing node_modules. But it throwed the same error again.

melloc commented 6 years ago

@senthil5053 Can you run rm -rf node_modules && V=1 npm install and paste the output? If there's a build problem that should help show it.

joeyhage commented 6 years ago

@melloc I have the same issue as @senthil5053 and have tried everything to resolve this. npm rebuild, npm rebuild dtrace-provider, rm -rf node_modules && npm install and looked through dozens of stack overflow questions but no luck. My code runs fine so far but I get an ugly error exactly like @senthil5053's original post each time a run npm start.

I ran rm -rf node_modules && V=1 npm install and got the following:

dtrace-provider@0.8.5 install /Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider
node scripts/install.js

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  LD_LIBRARY_PATH=/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/build/Release/lib.host:/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; sh libusdt-build.sh
Building libusdt for x86_64
rm -f *.gch
rm -f *.o
rm -f libusdt.a
rm -f test_usdt
rm -f test_usdt32
rm -f test_usdt64
rm -f test_mem_usage
gcc -O2 -Wall -arch x86_64   -c -o usdt.o usdt.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_file.o usdt_dof_file.c
gcc -arch x86_64 -o usdt_tracepoints.o -c usdt_tracepoints_x86_64.s
gcc -O2 -Wall -arch x86_64   -c -o usdt_probe.o usdt_probe.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof.o usdt_dof.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_sections.o usdt_dof_sections.c
rm -f libusdt.a
ar cru libusdt.a usdt.o usdt_dof_file.o usdt_tracepoints.o usdt_probe.o usdt_dof.o usdt_dof_sections.o 
ranlib libusdt.a
  touch Release/obj.target/libusdt.stamp
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_provider.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_provider.o ../dtrace_provider.cc
../dtrace_provider.cc:89:35: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
    v8::Local<Object> pd = klass->NewInstance();
                                  ^
/Users/Joey/.node-gyp/9.3.0/include/node/v8.h:3848:3: note: 'NewInstance' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
  ^
/Users/Joey/.node-gyp/9.3.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../dtrace_provider.cc:96:10: warning: 'ForceSet' is deprecated [-Wdeprecated-declarations]
    Nan::ForceSet(pd, Nan::New<String>("__prov__").ToLocalChecked(), obj,
         ^
../../nan/nan_maybe_43_inl.h:116:1: note: 'ForceSet' has been explicitly marked deprecated here
NAN_DEPRECATED inline Maybe<bool> ForceSet(
^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
2 warnings generated.
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_probe.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_probe.o ../dtrace_probe.cc
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_argument.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_argument.o ../dtrace_argument.cc
  c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++  -o Release/DTraceProviderBindings.node Release/obj.target/DTraceProviderBindings/dtrace_provider.o Release/obj.target/DTraceProviderBindings/dtrace_probe.o Release/obj.target/DTraceProviderBindings/dtrace_argument.o -L/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt -l usdt
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_file.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_sections.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_probe.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_tracepoints.o)) was built for newer OSX version (10.13) than being linked (10.7)

> dtrace-provider@0.7.1 install /Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider
> node scripts/install.js

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  LD_LIBRARY_PATH=/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/lib.host:/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; sh libusdt-build.sh
Building libusdt for x86_64
rm -f *.gch
rm -f *.o
rm -f libusdt.a
rm -f test_usdt
rm -f test_usdt32
rm -f test_usdt64
rm -f test_mem_usage
gcc -O2 -Wall -arch x86_64   -c -o usdt.o usdt.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_file.o usdt_dof_file.c
gcc -arch x86_64 -o usdt_tracepoints.o -c usdt_tracepoints_x86_64.s
gcc -O2 -Wall -arch x86_64   -c -o usdt_probe.o usdt_probe.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof.o usdt_dof.c
gcc -O2 -Wall -arch x86_64   -c -o usdt_dof_sections.o usdt_dof_sections.c
rm -f libusdt.a
ar cru libusdt.a usdt.o usdt_dof_file.o usdt_tracepoints.o usdt_probe.o usdt_dof.o usdt_dof_sections.o 
ranlib libusdt.a
  touch Release/obj.target/libusdt.stamp
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_provider.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_provider.o ../dtrace_provider.cc
../dtrace_provider.cc:89:35: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
    v8::Local<Object> pd = klass->NewInstance();
                                  ^
/Users/Joey/.node-gyp/9.3.0/include/node/v8.h:3848:3: note: 'NewInstance' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
  ^
/Users/Joey/.node-gyp/9.3.0/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
1 warning generated.
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_probe.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_probe.o ../dtrace_probe.cc
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../libusdt -I../../../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/DTraceProviderBindings/dtrace_argument.o.d.raw   -c -o Release/obj.target/DTraceProviderBindings/dtrace_argument.o ../dtrace_argument.cc
  c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++  -o Release/DTraceProviderBindings.node Release/obj.target/DTraceProviderBindings/dtrace_provider.o Release/obj.target/DTraceProviderBindings/dtrace_probe.o Release/obj.target/DTraceProviderBindings/dtrace_argument.o -L/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt -l usdt
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_file.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_sections.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_probe.o)) was built for newer OSX version (10.13) than being linked (10.7)
ld: warning: object file (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_tracepoints.o)) was built for newer OSX version (10.13) than being linked (10.7)

> fsevents@1.1.2 install /Users/Joey/git/isu-misclub-checkin/node_modules/fsevents
> node install

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.2 and node@9.3.0 (node-v59 ABI) (falling back to source compile with node-gyp) 
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++  -o Release/.node  
  c++ '-DNODE_GYP_MODULE_NAME=fse' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Joey/.node-gyp/9.3.0/include/node -I/Users/Joey/.node-gyp/9.3.0/src -I/Users/Joey/.node-gyp/9.3.0/deps/uv/include -I/Users/Joey/.node-gyp/9.3.0/deps/v8/include -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/fse/fsevents.o.d.raw   -c -o Release/obj.target/fse/fsevents.o ../fsevents.cc
  c++ -bundle -framework CoreFoundation -framework CoreServices -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.7 -arch x86_64 -L./Release -stdlib=libc++  -o Release/fse.node Release/obj.target/fse/fsevents.o 
  rm -rf "/Users/Joey/git/isu-misclub-checkin/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node" && cp -af "Release/fse.node" "/Users/Joey/git/isu-misclub-checkin/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node"
  touch Release/obj.target/action_after_build.stamp
melloc commented 6 years ago

@joeyhage Despite the xcode-select messages, it looks like compilation succeeded. If you run:

$ npm version
$ node --version

Do the versions match? Also, can you run:

$ find node_modules -name DTraceProviderBindings.node

Does that find the bindings?

joeyhage commented 6 years ago

@melloc Everything looks good to me; see below. Is there any way to mute these errors then if they are not causing problems?

$ npm version
{ 'isu-misclub-checkin': '0.1.0',
  npm: '5.5.1',
  ares: '1.13.0',
  cldr: '32.0',
  http_parser: '2.7.0',
  icu: '60.1',
  modules: '59',
  nghttp2: '1.25.0',
  node: '9.3.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.18.0',
  v8: '6.2.414.46-node.15',
  zlib: '1.2.11' }
$ node --version
v9.3.0
$ find node_modules -name DTraceProviderBindings
node_modules/ldapjs/node_modules/dtrace-provider/build/Release/obj.target/DTraceProviderBindings
node_modules/ldapjs/node_modules/dtrace-provider/build/Release/.deps/Release/obj.target/DTraceProviderBindings
node_modules/dtrace-provider/build/Release/obj.target/DTraceProviderBindings
node_modules/dtrace-provider/build/Release/.deps/Release/obj.target/DTraceProviderBindings
melloc commented 6 years ago

@joeyhage Can you rerun the find command but with DTraceProviderBindings.node?

Is there any way to mute these errors then if they are not causing problems?

I've made some changes to how things build/import for #96 which will suppress the warnings that the library prints by default. But, if you're getting the same messages that @senthil5053 is:

Error: The module '/Users/vananse/Senthil/Verizon/Sensity/GitHub/DevelopBranch/Farallones/api_tests/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

Then those get printed by node, and the library can't control them. I'm going to add an environment variable to allow skipping loading the binding, which would prevent it from trying to load the binding at all.

Can you copy the error that you're seeing here? It would help to know exactly what's printing. It looks like npm is using the same node version you're running with and compiling is succeeding for both the v0.8.5 and v0.7.1 versions you have installed, so it's not clear why you would be having anything printed at runtime.

joeyhage commented 6 years ago

@melloc In case it helps, this is being run from an Electron app.

Find command

$ find node_modules -name DTraceProviderBindings.node
node_modules/ldapjs/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node
node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node

Error

Error: The module '/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
[1] was compiled against a different Node.js version using
[1] NODE_MODULE_VERSION 59. This version of Node.js requires
[1] NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
[1] the module (for instance, using `npm rebuild` or`npm install`).
[1]     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
[1]     at Object.Module._extensions..node (module.js:598:18)
[1]     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
[1]     at Module.load (module.js:488:32)
[1]     at tryModuleLoad (module.js:447:12)
[1]     at Function.Module._load (module.js:439:3)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/dtrace-provider.js:18:23)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/dtrace-provider.js:49:3)
[1] Error: The module '/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
[1] was compiled against a different Node.js version using
[1] NODE_MODULE_VERSION 59. This version of Node.js requires
[1] NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
[1] the module (for instance, using `npm rebuild` or`npm install`).
[1]     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
[1]     at Object.Module._extensions..node (module.js:598:18)
[1]     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
[1]     at Module.load (module.js:488:32)
[1]     at tryModuleLoad (module.js:447:12)
[1]     at Function.Module._load (module.js:439:3)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:42:3)
[1] { Error: Cannot find module './build/default/DTraceProviderBindings'
[1]     at Module._resolveFilename (module.js:470:15)
[1]     at Function.Module._resolveFilename (/Users/Joey/git/isu-misclub-checkin/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
[1]     at Function.Module._load (module.js:418:25)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:42:3)
[1]     at Module._compile (module.js:571:32)
[1]     at Object.Module._extensions..js (module.js:580:10)
[1]     at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' }
[1] { Error: Cannot find module './build/Debug/DTraceProviderBindings'
[1]     at Module._resolveFilename (module.js:470:15)
[1]     at Function.Module._resolveFilename (/Users/Joey/git/isu-misclub-checkin/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
[1]     at Function.Module._load (module.js:418:25)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:17:23)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/ldapjs/node_modules/dtrace-provider/dtrace-provider.js:42:3)
[1]     at Module._compile (module.js:571:32)
[1]     at Object.Module._extensions..js (module.js:580:10)
[1]     at Module.load (module.js:488:32) code: 'MODULE_NOT_FOUND' }
melloc commented 6 years ago

In case it helps, this is being run from an Electron app.

Ah, that's probably it then. I haven't developed with Electron, but I believe they bundle and use their own build of node. I assume that's what the Node: 7.9.0 on their website is referring to, and would explain the version mismatch. You may want to try building your dependencies using the version of node that Electron is running them with and see if that fixes the problem.

joeyhage commented 6 years ago

@melloc Thanks for the help thus far! That makes sense. But how do I build against NODE_MODULE_VERSION 54? As listed by Node.js, Node: 7.9.0 has NODE_MODULE_VERSION 51. There is no 54. When I switched to Node: 7.9.0, and ran rm -rf node_modules && npm install my error message shortened but is now as follows:

[1] Error: The module '/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
[1] was compiled against a different Node.js version using
[1] NODE_MODULE_VERSION 51. This version of Node.js requires
[1] NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
[1] the module (for instance, using `npm rebuild` or`npm install`).
[1]     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
[1]     at Object.Module._extensions..node (module.js:598:18)
[1]     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
[1]     at Module.load (module.js:488:32)
[1]     at tryModuleLoad (module.js:447:12)
[1]     at Function.Module._load (module.js:439:3)
[1]     at Module.require (module.js:498:17)
[1]     at require (internal/module.js:20:19)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/dtrace-provider.js:18:23)
[1]     at Object.<anonymous> (/Users/Joey/git/isu-misclub-checkin/node_modules/dtrace-provider/dtrace-provider.js:49:3)
melloc commented 6 years ago

@joeyhage It appears that NODE_MODULE_VERSION 54 is specific to electron. I found this:

https://electronjs.org/docs/tutorial/using-native-node-modules

It seems that Electron has a program you can install, electron-rebuild, which should take care of rebuilding your dependencies against the right version.

joeyhage commented 6 years ago

@melloc Thanks! I have electron-rebuild, but I might need to change the version I am using. I will keep playing around with it. Regardless, I appreciate your help!

melloc commented 6 years ago

I'm going to close the issue since the cause seems to be understood (building against a different version of node). In the case of Electron where npm won't necessarily use the right node, there seems to be a solution, electron-rebuild.

inderpreet99 commented 5 years ago

I was having problems with bunyan using dtrace-provider on Mac OSX:

{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at new <anonymous> (/Users/isingh/proj/app/node_modules/esm/esm.js:1:50548)
    at Proxy.<anonymous> (/Users/isingh/proj/app/node_modules/esm/esm.js:1:213092)
    at Proxy.<anonymous> (/Users/isingh/proj/app/node_modules/esm/esm.js:1:211499)
    at Object.<anonymous> (/Users/isingh/proj/app/node_modules/esm/esm.js:1:215031)
    at Object.t (/Users/isingh/proj/app/node_modules/esm/esm.js:1:235484)
    at o (/Users/isingh/proj/app/node_modules/esm/esm.js:1:235191)
    at Object.<anonymous> (/Users/isingh/proj/app/node_modules/dtrace-provider/dtrace-provider.js:18:23)
    at yl (/Users/isingh/proj/app/node_modules/esm/esm.js:1:200167)
    at Object.run (/Users/isingh/proj/app/node_modules/esm/esm.js:1:199863)
    at Object.<anonymous> (/Users/isingh/proj/app/node_modules/dtrace-provider/dtrace-provider.js:1:96) code: 'MODULE_NOT_FOUND' }

It turns out that the optional dependency dtrace-provider will output the above error when it's not found, so I ran V=1 npm rebuild to see what was going wrong. By updating to the latest npm and xcode tooling, I was able to get rid of the problem:

sudo xcode-select --install
npm install -g npm
npm rebuild