trentm / node-bunyan

a simple and fast JSON logging module for node.js services
Other
7.17k stars 515 forks source link

Still getting lots of DtraceProviderBindings errors on OS X #216

Closed howarddierking closed 6 years ago

howarddierking commented 9 years ago

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 commented 9 years ago

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

gregjopa commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

Problem occurs when we use iojs.

gregjopa commented 9 years ago

@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 commented 9 years ago

@gregjopa ok, will use node for now

kievechua commented 9 years ago

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

trentm commented 9 years ago

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

trentm commented 9 years ago

@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 commented 9 years ago

@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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

@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.

andyburke commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

$ 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 commented 8 years ago

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 x8664 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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

rm the node-modules dir and npm install

joybro commented 8 years ago

Same issue here.

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

krisbulman commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

urecio commented 8 years ago

Same error here with npm 3.5.3 and node 5.5.0

lavie commented 8 years ago

Same error with node 4.3.0 and npm 3.7.1...

vishalgakhare commented 8 years ago

Same error when I debug or run: { [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' } node 4.2.6 IOJS 3.31 npm 2.14.12

andrewmunro commented 8 years ago

Using npm install --no-optional seems to fix it, but a permanent solution would be nice.

deepal commented 8 years ago

@andrewmunro : npm install --no-optional worked for me. Thanks for the fix dude.

geakstr commented 8 years ago

npm install --no-optional not work for me, i'm getting

{ [Error: Cannot find module './build/Release/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

while node index.js.

node 5.7.0, npm 3.6.0, os x 10.11.3, xcode 7.2.1, bunyan 1.7.0, restify 4.0.4

bennybennet commented 8 years ago

same here

[Error: Module version mismatch. Expected 47, got 46.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }

node 5.7.0, npm 3.6.0, bunyan 1.7.1, restify 4.0.3

andrewmunro commented 8 years ago

@geakstr @bennybennet Did you try removing your node-modules folders first?

rm -rf node_modules/ && npm install --no-optional

The reason you are seeing this error is because node-bunyan uses dtrace-provider as an optional dependency which is not supported for mac os x.

IMHO This issue should probably be closed. It's not a problem with node-bunyan, more an issue with the fact that npm installs optional dependencies by default.

geakstr commented 8 years ago

@andrewmunro yes, I did rm and install with --no-optional flag

bennybennet commented 8 years ago

rm -rf node_modules/ && npm install (without --no-optional) worked for me.

chihungsiu commented 8 years ago

@andrewmunro :npm install --no-optional worked for me as well. Thanks for solving this painful thing.

jbcpollak commented 8 years ago

--no-optional doesn't seem like a solution, what if other modules need optional components?

On Mon, Mar 7, 2016, 4:32 AM chihungsiu notifications@github.com wrote:

@andrewmunro https://github.com/andrewmunro : npm install --no-optional worked for me as well. Thanks for solving this painful thing.

— Reply to this email directly or view it on GitHub https://github.com/trentm/node-bunyan/issues/216#issuecomment-193179737.

andrewmunro commented 8 years ago

@jbcpollak ...Then they wouldn't be optional?

jbcpollak commented 8 years ago

@andrewmunro they might not be optional for the project depending on them right?

For example, let's say my project depends on library-A and library-B:

1) library-A has optional dependencies that aren't necessary to my project 2) library-B has optional dependencies that are necessary to my project

If I run npm install --no-optional

I won't get the optional features of library-B.

I don't have a specific scenario for this, I'm just point it out as a potential problem. I think this is a symptom of npm's weak control of dependencies.

jameswomack commented 8 years ago

Using NPM 3 instead of 2 also solved the issue for me.

readworks commented 8 years ago

You probably have a globally installed npm library that is incompatible with your node version. Try removing, e.g., npm remove node-gyp -g and reinstalling it along with other globally installed libraries and then try to do your local npm install. Good luck!

franky-continu commented 8 years ago

After rm -rf node_modules && npm install --no-optionals


✔ ~/Workspace/continu/continu-api [master|✚ 1] 
19:52 $ npm start

> continu-api@1.0.0 start /Users/user/workspace/company/api
> node server.js

assert.js:90
  throw new assert.AssertionError({
  ^
AssertionError: "rotating-file" stream type is not supported: missing "mv" module
    at Logger.addStream (/Users/user/workspace/company/api/node_modules/bunyan/lib/bunyan.js:606:16)
    at /Users/user/workspace/company/api/node_modules/bunyan/lib/bunyan.js:469:18
    at Array.forEach (native)
    at new Logger (/Users/user/workspace/company/api/node_modules/bunyan/lib/bunyan.js:468:25)
    at Object.<anonymous> (/Users/user/workspace/company/api/server.js:29:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:445:3

npm ERR! Darwin 15.4.0
npm ERR! argv "/Users/franky/.nvm/versions/node/v6.1.0/bin/node" "/Users/franky/.nvm/versions/node/v6.1.0/bin/npm" "start"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! continu-api@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the continu-api@1.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the continu-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs continu-api
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls continu-api
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/user/workspace/company/api/npm-debug.log
titoesteves commented 8 years ago

rm -rf node_modules/ && npm install --no-optional worked for me as well. Update: rm -rf node_modules/ && npm install without no-optional worked as well.

jbcpollak commented 8 years ago

I just want to say --no-optional seems like a workaround, it isn't a long term solution. Its a global flag for all of npm, which means not only are the optional dependencies for node-bunyan left out, all the optional dependencies of your other dependencies are left out, and that could have unintended consequences.

I'd rather have the console warnings appear than have some unexplained side effect caused by dropping optional dependencies I'm not aware of.

franky-continu commented 8 years ago

That also makes formatters or streams for restify not work. It is that or some other component not work. I’ll write as soon as I have moment to test back home.

On Jun 2, 2016, at 11:53 AM, Tito Esteves notifications@github.com wrote:

rm -rf node_modules/ && npm install --no-optional worked for me as well.

franky-continu commented 8 years ago

+1

On Jun 2, 2016, at 11:55 AM, Joshua Chaitin-Pollak notifications@github.com wrote:

I just want to say --no-optional seems like a workaround, it isn't a long term solution. Its a global flag for all of npm, which means not only are the optional dependencies for node-bunyan left out, all the optional dependencies of your other dependencies are left out, and that could have unintended consequences.

I'd rather have the console warnings appear than have some unexplained side effect caused by dropping optional dependencies I'm not aware of.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/trentm/node-bunyan/issues/216#issuecomment-223370534, or mute the thread https://github.com/notifications/unsubscribe/AKXbtLu7akwhIsdsY4yQQowspDuJzVKUks5qHxktgaJpZM4DTpaW.

jbcpollak commented 8 years ago

@trentm - This issue is closed but it seems a lot of people are still having the same symptoms. Should we create a new issue or can you reopen this one? In this case it seems to be a node 6 issue.

jbcpollak commented 8 years ago

Looks like #416 might be a new Node 6 related issue

kevinstumpf commented 8 years ago

The same error occurred on my end because my environment's python pointed to version 3.5 (rather than 2.7, which is dtrace-provider's only supported version). Linking to 2.7 and reinstalling restify fixed the issue for me

franky-continu commented 8 years ago

Guys if you have this still happening to you would you please + 1 #424 ?

Thanks

venkatesh-tr commented 8 years ago

Happening after moving to Node 6.3 recently.