Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still getting lots of DtraceProviderBindings errors on OS X #216

Closed
howarddierking opened this issue Jan 17, 2015 · 90 comments
Closed

Still getting lots of DtraceProviderBindings errors on OS X #216

howarddierking opened this issue Jan 17, 2015 · 90 comments

Comments

@howarddierking
Copy link

I know that this issue has been discussed at great length in the past, and I revisited some of those issues/discussions before posting this. I'm not sure if I'm just not reading the previous resolutions correctly or if something else is going on, but I'm still getting a bunch of this error when running mocha tests for my code that's using buyan:

[SyntaxError: Unexpected token ILLEGAL]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

I'm running OS X Yosemite.

Any ideas on getting rid of this message? It's not the end of the world, but it's pretty annoying and, more importantly, it's slowing down my test runs.

thanks,

_howard

@trentm
Copy link
Owner

trentm commented Jan 17, 2015

Can you gist a full 'npm install' run? Do you get that error when just doing require('bunyan') in the node repl?

@gregjopa
Copy link

I was getting this error too and it turned out to be a configuration issue after updating to OS X Yosemite. I installed the Xcode command line tools but never accepted the user agreement in Xcode. Argh :)

If you are getting this error you may see the following when running "npm install bunyan":

---------------
Building dtrace-provider failed with exit code 1 and signal 0
re-run install with environment variable V set to see the build output
---------------

Setting the "V" environment variable will give you more info as to why npm failed to install bunyan:

YPCMC12678:bunyan-test gj870q$ pwd
/Users/gj870q/bunyan-test
YPCMC12678:bunyan-test gj870q$ export V=/Users/gj870q/bunyan-test
YPCMC12678:bunyan-test gj870q$ npm install bunyan

|
> dtrace-provider@0.3.1 install /Users/gj870q/node_modules/bunyan/node_modules/dtrace-provider
> scripts/install.js

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 69
gyp ERR! stack     at ChildProcess.onExit (/Users/gj870q/.nvm/v0.10.32/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/Users/gj870q/.nvm/v0.10.32/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/gj870q/node_modules/bunyan/node_modules/dtrace-provider
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
bunyan@1.3.2 ../node_modules/bunyan
├── safe-json-stringify@1.0.1
├── mv@2.0.3 (rimraf@2.2.8, ncp@0.6.0, mkdirp@0.5.0)
└── dtrace-provider@0.3.1 (nan@1.3.0)

After opening Xcode on my mac and accepting the user agreement it fixed my problem. I can now successfully use bunyan on OS X Yosemite.

@howarddierking
Copy link
Author

interestingly enough, I don't seem to be getting any build errors. Here's my verbose output:

➜  loggerTest  npm install bunyan

> dtrace-provider@0.3.1 install /Users/howardd/Dev/scratch/loggerTest/node_modules/bunyan/node_modules/dtrace-provider
> scripts/install.js

  LD_LIBRARY_PATH=/Users/howardd/Dev/scratch/loggerTest/node_modules/bunyan/node_modules/dtrace-provider/build/Release/lib.host:/Users/howardd/Dev/scratch/loggerTest/node_modules/bunyan/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++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howardd/.node-gyp/0.10.35/src -I/Users/howardd/.node-gyp/0.10.35/deps/uv/include -I/Users/howardd/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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
  c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howardd/.node-gyp/0.10.35/src -I/Users/howardd/.node-gyp/0.10.35/deps/uv/include -I/Users/howardd/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howardd/.node-gyp/0.10.35/src -I/Users/howardd/.node-gyp/0.10.35/deps/uv/include -I/Users/howardd/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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
  ./gyp-mac-tool flock ./Release/linker.lock c++ -bundle -Wl,-search_paths_first -mmacosx-version-min=10.5 -arch x86_64 -L./Release  -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 -undefined dynamic_lookup -L/Users/howardd/Dev/scratch/loggerTest/node_modules/bunyan/node_modules/dtrace-provider/libusdt -l usdt
  SOLINK_MODULE(target) Release/DTraceProviderBindings.node: Finished
bunyan@1.3.2 node_modules/bunyan
├── safe-json-stringify@1.0.1
├── mv@2.0.3 (rimraf@2.2.8, ncp@0.6.0, mkdirp@0.5.0)
└── dtrace-provider@0.3.1 (nan@1.3.0)

@gregberge
Copy link

Problem occurs when we use iojs.

@gregjopa
Copy link

@neoziro there is a known issue with the dtrace-provider with io.js that is reported in issue #212.

@howarddierking I'm not sure about the error you're getting. Do you have the latest version of xcode installed?

I have bunyan working on my mac with OS X Yosemite:

Xcode version 6.1.1 (6A2008a)

$ node --version
v0.10.35
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

@gregberge
Copy link

@gregjopa ok, will use node for now

@kievechua
Copy link

Using node 0.11 it show this. Same issue?
[Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND'

@trentm
Copy link
Owner

trentm commented Feb 6, 2015

@neoziro The issue with io.js is fixed with latest. The fix was to update to dtrace-provider 0.4.0.

@trentm
Copy link
Owner

trentm commented Feb 6, 2015

@kievechua With the latest bunyan (using dtrace-provider 0.4.0) you shouldn't be getting that. I'd need more details (bunyan version, node version, your platform details, etc.) to confirm.

@trentm
Copy link
Owner

trentm commented Feb 6, 2015

@howarddierking Can you first try with bunyan 1.3.3 that updates to dtrace-provider 0.4.0? Then, does this work:

$ cd .../your/project/dir/that/uses/bunyan
$ npm install bunyan
...
$ cd node_modules/bunyan
$ node
> process.version
'v0.10.28'
> require('dtrace-provider')
{ DTraceProvider: [Function: DTraceProvider],
  createDTraceProvider: [Function] }

@howarddierking
Copy link
Author

Still getting the error, but investigating to see if there may be something else going on, because I'm not seeing it in a different project. Will update as I discover more, but here's my verbose output.

➜  proj git:(dev) ✗ npm install bunyan

> dtrace-provider@0.4.0 install /proj/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js

  LD_LIBRARY_PATH=/proj/node_modules/bunyan/node_modules/dtrace-provider/build/Release/lib.host:/proj/node_modules/bunyan/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++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howarddierking/.node-gyp/0.10.35/src -I/Users/howarddierking/.node-gyp/0.10.35/deps/uv/include -I/Users/howarddierking/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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
  c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howarddierking/.node-gyp/0.10.35/src -I/Users/howarddierking/.node-gyp/0.10.35/deps/uv/include -I/Users/howarddierking/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/howarddierking/.node-gyp/0.10.35/src -I/Users/howarddierking/.node-gyp/0.10.35/deps/uv/include -I/Users/howarddierking/.node-gyp/0.10.35/deps/v8/include -I../libusdt -I../node_modules/nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -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
  ./gyp-mac-tool flock ./Release/linker.lock c++ -bundle -Wl,-search_paths_first -mmacosx-version-min=10.5 -arch x86_64 -L./Release  -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 -undefined dynamic_lookup -L/proj/node_modules/bunyan/node_modules/dtrace-provider/libusdt -l usdt
  SOLINK_MODULE(target) Release/DTraceProviderBindings.node: Finished
bunyan@1.3.3 node_modules/bunyan
├── safe-json-stringify@1.0.1
├── mv@2.0.3 (rimraf@2.2.8, ncp@0.6.0, mkdirp@0.5.0)
└── dtrace-provider@0.4.0 (nan@1.5.3)

@howarddierking
Copy link
Author

ok - found that the issue in my case was related to using https://github.com/felixge/node-sandboxed-module. When you use sandboxed-module to require a module that has a downstream dependency on Bunyan, sandboxed-module tries to recursively create fakes for all of the descendent modules - and whatever it happens to create for Bunyan doesn't have the proper Dtrace binding dependency. At any rate, I've corrected the issue by switching my approach for plugging in the fakes.

@trentm
Copy link
Owner

trentm commented Apr 13, 2015

@howarddierking Thanks for getting back on this!

AFAIK the issue here is fixed. Happy for new issues or re-opening if someone has repro details for a failure case.

@trentm trentm closed this as completed Apr 13, 2015
@andyburke
Copy link

This is still an issue if you have certain characters in your path on OSX:

  LD_LIBRARY_PATH=/Users/aburke/Dropbox (Personal)/...
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `LD_LIBRARY_PATH=/Users/aburke/Dropbox (Personal)/...
make: *** [.] Error 2

@TravelingTechGuy
Copy link

I'm on Mac OSX 10.9.5, XCode 6.2, NodeJS 4.1.2 and I get this:

$ V=/Users/user/project  npm i bunyan
npm WARN package.json ohcm-core-restify@1.0.0 No repository field.
npm WARN package.json ohcm-core-restify@1.0.0 No README data

> dtrace-provider@0.6.0 install /Users/user/project/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 104.20.23.46:443
gyp ERR! stack     at Object.exports._errnoException (util.js:849:11)
gyp ERR! stack     at exports._exceptionWithHostPort (util.js:872:20)
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "/usr/local/Cellar/node/4.1.2/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/project/node_modules/bunyan/node_modules/dtrace-provider
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
bunyan@1.5.1 node_modules/bunyan
├── safe-json-stringify@1.0.3
├── mv@2.1.1 (ncp@2.0.0, mkdirp@0.5.1, rimraf@2.4.3)
└── dtrace-provider@0.6.0 (nan@2.1.0)

(user name and project names changed - everything else is the same)

@zgpeace
Copy link

zgpeace commented Oct 24, 2015

$ npm install hexo --no-optional
work for me

ChenJohns-MacBook-Air:hexo JohnChen$ hexo --version
hexo: 3.1.1
os: Darwin 15.0.0 darwin x64
http_parser: 2.5.0
node: 4.2.1
v8: 4.5.103.35
uv: 1.7.5
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 46
openssl: 1.0.2d

@bjm88
Copy link

bjm88 commented Nov 2, 2015

My error seems to be related to dtrace compiling and node-gyp.js

dtrace-provider@0.6.0 install /Users/Ben/caredox/caredox_util/node_modules/bunyan/node_modules/dtrace-provider

node scripts/install.js

LD_LIBRARY_PATH=/Users/Ben/caredox/caredox_util/node_modules/bunyan/node_modules/dtrace-provider/build/Release/lib.host:/Users/Ben/caredox/caredox_util/node_modules/bunyan/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' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/Ben/.node-gyp/4.2.1/include/node -I/Users/Ben/.node-gyp/4.2.1/src -I/Users/Ben/.node-gyp/4.2.1/deps/uv/include -I/Users/Ben/.node-gyp/4.2.1/deps/v8/include -I../libusdt -I../node_modules/nan -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -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
cc1plus: error: unrecognized command line option "-std=gnu++0x"
make: *
* [Release/obj.target/DTraceProviderBindings/dtrace_provider.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/Ben/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/Users/Ben/.nvm/versions/node/v4.2.1/bin/node" "/Users/Ben/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Ben/caredox/caredox_util/node_modules/bunyan/node_modules/dtrace-provider
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
bunyan@1.5.1 node_modules/bunyan
├── safe-json-stringify@1.0.3
├── mv@2.1.1 (ncp@2.0.0, mkdirp@0.5.1, rimraf@2.4.3)
└── dtrace-provider@0.6.0 (nan@2.1.0)

@pswai
Copy link

pswai commented Nov 16, 2015

My issue was not properly installed touch module.
Reinstalling touch and bunyan fixed the problem.

> dtrace-provider@0.6.0 install /Users/parksoon_my/WebstormProjects/pandora/node_modules/dtrace-provider
> node scripts/install.js

---------------
Building dtrace-provider failed with exit code 1 and signal 0
re-run install with environment variable V set to see the build output
---------------

> utf-8-validate@1.2.1 install /Users/parksoon_my/WebstormProjects/pandora/node_modules/utf-8-validate
> node-gyp rebuild

  CXX(target) Release/obj.target/validation/src/validation.o
/Users/parksoon_my/WebstormProjects/pandora/node_modules/.bin/touch: line 1: syntax error near unexpected token `('
/Users/parksoon_my/WebstormProjects/pandora/node_modules/.bin/touch: line 1: `var touch = require("../touch")'
make: *** [Release/obj.target/validation/src/validation.o] Error 2
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:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/parksoon_my/WebstormProjects/pandora/node_modules/utf-8-validate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN install:utf-8-validate utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate Exit status 1

@jeffhiltz
Copy link

For me this was fixed by upgrading my npm. I'm on OS X EL Capitan and went from npm version 1.4.28 to 3.4.0 and the problem went away. (Node.JS version 5.0.0)

@b6t
Copy link

b6t commented Dec 9, 2015

rm the node-modules dir and npm install

@joybro
Copy link

joybro commented Jan 10, 2016

Same issue here.

OS X El Capitan
npm 3.3.12
node.js 5.4.0
gcc LLVM 6.1.0

@krisbulman
Copy link

Same as @andyburke, bunyan fails if you have parens in the path you attempt to run npm install from. In my case it was /Dropbox (Personal)/. I moved it to a root dir, re-ran install and it worked fine.

@jbcpollak
Copy link

I'm having a similar problem, although I don't get compiler errors I do get some warnings:

OS X El Capitan (10.11.2)
node: v4.2.1
npm: 3.5.3
gcc: LLVM version 7.0.2 (clang-700.1.81)

I see this when installing bunyan:

Strelka:test josh$ npm install bunyan

> dtrace-provider@0.6.0 install /private/tmp/test/node_modules/dtrace-provider
> node scripts/install.js

  LD_LIBRARY_PATH=/private/tmp/test/node_modules/dtrace-provider/build/Release/lib.host:/private/tmp/test/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' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/josh/.node-gyp/4.2.1/include/node -I/Users/josh/.node-gyp/4.2.1/src -I/Users/josh/.node-gyp/4.2.1/deps/uv/include -I/Users/josh/.node-gyp/4.2.1/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -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
  c++ '-DNODE_GYP_MODULE_NAME=DTraceProviderBindings' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/josh/.node-gyp/4.2.1/include/node -I/Users/josh/.node-gyp/4.2.1/src -I/Users/josh/.node-gyp/4.2.1/deps/uv/include -I/Users/josh/.node-gyp/4.2.1/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -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' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/josh/.node-gyp/4.2.1/include/node -I/Users/josh/.node-gyp/4.2.1/src -I/Users/josh/.node-gyp/4.2.1/deps/uv/include -I/Users/josh/.node-gyp/4.2.1/deps/v8/include -I../libusdt -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -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,-search_paths_first -mmacosx-version-min=10.5 -arch x86_64 -L./Release -L/opt/boxen/homebrew/lib -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/private/tmp/test/node_modules/dtrace-provider/libusdt -l usdt
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt.o)) was built for newer OSX version (10.11) than being linked (10.5)
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_file.o)) was built for newer OSX version (10.11) than being linked (10.5)
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof_sections.o)) was built for newer OSX version (10.11) than being linked (10.5)
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_dof.o)) was built for newer OSX version (10.11) than being linked (10.5)
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_probe.o)) was built for newer OSX version (10.11) than being linked (10.5)
ld: warning: object file (/private/tmp/test/node_modules/dtrace-provider/libusdt/libusdt.a(usdt_tracepoints.o)) was built for newer OSX version (10.11) than being linked (10.5)
/private/tmp/test
└─┬ bunyan@1.5.1 
  ├─┬ dtrace-provider@0.6.0 
  │ └── nan@2.2.0 
  ├─┬ mv@2.1.1 
  │ ├─┬ mkdirp@0.5.1 
  │ │ └── minimist@0.0.8 
  │ ├── ncp@2.0.0 
  │ └─┬ rimraf@2.4.5 
  │   └─┬ glob@6.0.4 
  │     ├─┬ inflight@1.0.4 
  │     │ └── wrappy@1.0.1 
  │     ├── inherits@2.0.1 
  │     ├─┬ minimatch@3.0.0 
  │     │ └─┬ brace-expansion@1.1.2 
  │     │   ├── balanced-match@0.3.0 
  │     │   └── concat-map@0.0.1 
  │     ├── once@1.3.3 
  │     └── path-is-absolute@1.0.0 
  └── safe-json-stringify@1.0.3 

@ceecer1
Copy link

ceecer1 commented Feb 2, 2016

It is Feb 2016, is this still the same? I am getting the same error.

@urecio
Copy link

urecio commented Feb 10, 2016

Same error here with npm 3.5.3 and node 5.5.0

@lavie
Copy link

lavie commented Feb 11, 2016

Same error with node 4.3.0 and npm 3.7.1...

@jamesplease
Copy link

fwiw, pino, a bunyan-inspired alternative, does not have this issue.

Pino facts:

If you need the Dtrace fanciness, then def. stick with bunyan. If you're running into this issue over and over, and don't need the Dtrace fanciness, then it might be that bunyan isn't the best logger for your use case.

@trentm
Copy link
Owner

trentm commented Mar 21, 2017

What @melloc said in #216 (comment) about likely being the result of a failure to build the binary part of dtrace-provider when that module was installed.

Then when bunyan.js does require('dtrace-provider') we get stderr warnings from: https://github.com/chrisa/node-dtrace-provider/blob/a1594b0ea17b6ba2329b0bf4160e91c892777004/dtrace-provider.js#L13-L29

However, that doesn't quite match up with the quoted errors from this comment: #216 (comment) where we see:

{ Error: Cannot find module './build/Release/DTraceProviderBindings'
...
{ Error: Cannot find module './build/default/DTraceProviderBindings'
...
{ Error: Cannot find module './build/Release/DTraceProviderBindings'
...
{ Error: Cannot find module './build/default/DTraceProviderBindings'
...

I.e. we see warnings from the "Release", then "default", then "Release", then "default". Given the code has:

var builds = ['Release', 'default', 'Debug'];

It feels like we are succeeding to import a debug build at "./build/Debug/DTraceProviderBindings" and also that we are requiring dtrace-provider from two different places.

Some thoughts:

  • Bunyan could do with a Troubleshooting section and set of commands/steps to run to verify the issue when a user hits a problem and gather all the relevant details to be able to debug it properly.
  • I don't think dtrace-provider should be writing to stderr in top-level code (and indeed at all) for warnings/errors. Ditto for any library. That makes it impossible for any script or app using that library to control the UX. In this case bunyan currently considers dtrace-provider an optional dep (though that was in part to ensure a failed build doesn't block bunyan module installation), so bunyan should be able to decide whether a failure to import dtrace-provider merits writing to stderr. This argues for having a change to dtrace-provider to have some other way to communicate to the caller that it couldn't import its DtraceProviderBindings. An easier first step would be to have dtrace-provider at least not warn for each of the 'Release', 'default', and 'Debug' possible builds; and to provide more actionable details.

@ljcastro
Copy link

In my case, the problem was python 3.5. Using the --python option to point to python 2.7 solves the issue.

@WarFox
Copy link

WarFox commented Apr 18, 2017

One more case of Python 3.5 on macOS Sierra. Required python version is 2.7

pyenv global 2.7.12

solved my issue

@fxfactorial
Copy link

OP doesn't care so I'm unsubscribing

@wesley-firewalla
Copy link

I still have the terrible error.
node v7.9.0

@chutch3
Copy link

chutch3 commented Apr 26, 2017

What ended up working for me was:

npm install dtrace-provider

Not sure why I had to do this though.

@OmgImAlexis
Copy link

OmgImAlexis commented May 29, 2017

Getting a similar issue here and adding @protomock your work around doesn't work for me. 😞

Error log
{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/xo/code/bitcannon-web/node_modules/bunyan/lib/bunyan.js:79:18)
    at Module._compile (module.js:571:32)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xo/code/bitcannon-web/node_modules/babel-register/lib/node.js:152:7) code: 'MODULE_NOT_FOUND' }

Looks like yarn doesn't work with --python. 😞

@bensampaio
Copy link

I'm getting this same issue with node@8.0.0 and yarn@0.24.6. I tried to remove my node_modules and install again but that didn't fix the problem. Any suggestions?

@rupamroy
Copy link

+1

$python --version
Python 2.7.10
GNWRALA2063193:demo 430014695
$node -v
v6.11.0
GNWRALA2063193:demo 430014695
$npm -v
3.10.10

@NBR-hugh
Copy link

  • My error message like below:
{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Edgar/Repos/fintech-hackathon/node_modules/bunyan/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Edgar/Repos/fintech-hackathon/node_modules/bunyan/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/Edgar/Repos/fintech-hackathon/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
  • And I update the OS X EI to version 10.11.6 fix this error.

@karlgroves
Copy link

I know this is an old issue but I wanted to comment on it in case anyone else has the same issue I had.

My issue was caused by having parentheses in my path.
/users/karlgroves/Dropbox (Personal)/foo/bar/bat/project...

Moving the project to a path without the parens worked for me.
You'll need to wipe out node_modules and reinstall again.

@melloc
Copy link
Collaborator

melloc commented Sep 8, 2017

@karlgroves That's a bug in node-gyp, which will be fixed once I finish cleaning up nodejs/node-gyp#1277, and find a Windows machine to test it on.

@matthamil
Copy link

I was able to resolve this by downloading python 2.7.12 with pyenv by running

CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.12

and then pyenv global 2.7.12, rm -rf node_modules, npm i and the problem was resolved for me.

@eugene1g
Copy link

What worked for me was to re-install node-gyp globally as per yarnpkg/yarn#1915 (comment)

yarn global add node-gyp
rm -rf node_modules yarn.lock
yarn install

Then these dtrace warning messages went away

@ubershmekel
Copy link

My solution was rm -rf node_modules/dtrace-provider in the package that relies on bunyan.

{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/yuval/proj/node_modules/dtrace-provider/dtrace-provider.js:18:23)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/yuval/proj/node_modules/bunyan/lib/bunyan.js:79:18)

@gnipbao
Copy link

gnipbao commented Oct 23, 2017

amazing!:sunglasses: rm -rf node_modules/ && npm install --no-optional works for me! cool!

@YuanLIAOcode
Copy link

Hi, I think this is the version of node js that causes this issue.

I met this issue after I updated my node from v6.10.0 to v8.1.3.

Here is my solution in my MaxOS:

Firstly I'm using nvm to manage the version of node.js.

Under the version v8.1.1.3, I use $nvm use v6.10.0 to turn my node version back.

Then I took the solution of @felipekm ,

under the root of my hexo project

$ rm -rf node_modules (to remove the previous node_modules directory)
then,
$ npm install --no-optional (to install a new node_modules directory based on the v6.10.0 version node)

@melloc
Copy link
Collaborator

melloc commented Jan 12, 2018

As of dtrace-provider@0.8.6, this message will no longer be printed to stderr at runtime, and the stub implementation will be used instead. If you want to use bunyan -p or write your own DTrace scripts to process Bunyan logs, then you can set NODE_DTRACE_PROVIDER_REQUIRE=hard during installation to force the build to fail and see why it failed. For example:

$ NODE_DTRACE_PROVIDER_REQUIRE=hard npm install

There is a list of common failure reasons in dtrace-provider's README. Please take a look there, throughout this ticket, and at #525 first before opening any bugs.

@whiteboardmonk
Copy link

amazing!😎 rm -rf node_modules/ && npm install --no-optional works for me! cool!

This worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests