Search code examples
node.jsmacosmacos-mojavedtrace

macOS & dyld: Symbol not found: _usdt_create_provider


In short, I'm unable to install @pact-foundation/pact-node on my development computer and from what I gather it seems to be loosely related to being on macOS 10.14. When I say loosely, this does not affect my other non-development computer running the same stack.

Within nvm I've tried using Node 8.14.0, 8.15.0, 9.4.0, 10.14.2, 10.15.0 and 11.6.0, in addition to system Node, which is also 11.6.0. Each version results in the same error messages, regardless of whether I'm in my team's project directory or in an otherwise empty sandbox directory.

Until a few minutes ago I was running macOS 10.14.1 and am seeing the same problems on 10.14.2. There are no updates that haven't been installed.

The package installation output is as follows.

$ npm install @pact-foundation/pact-node

> [email protected] install /Users/andrewgould/www/sandbox/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

  ACTION binding_gyp_ndtp_target_build_ndtp .
  TOUCH Release/obj.target/ndtp.stamp

> [email protected] postinstall /Users/andrewgould/www/sandbox/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /Users/andrewgould/www/sandbox/node_modules/caporal
> (test -f ./node_modules/husky/bin/install.js && node ./node_modules/husky/bin/install.js) || exit 0


> @pact-foundation/[email protected] postinstall /Users/andrewgould/www/sandbox/node_modules/@pact-foundation/pact-node
> node postinstall.js

dyld: lazy symbol binding failed: Symbol not found: _usdt_create_provider
  Referenced from: /Users/andrewgould/www/sandbox/node_modules/dtrace-provider/src/build/Release/DTraceProviderBindings.node
  Expected in: flat namespace

dyld: Symbol not found: _usdt_create_provider
  Referenced from: /Users/andrewgould/www/sandbox/node_modules/dtrace-provider/src/build/Release/DTraceProviderBindings.node
  Expected in: flat namespace

Abort trap: 6

Has anyone seen errors like these before? Is there a solution known?


Solution

  • It turns out this issue was caused by binutils, which I had installed via Homebrew. Uninstalling that fixed the problem.

    From the GNU binutils website, the main packages included in it are ld, the GNU linker, and as, the GNU assembler. Both tools are included with macOS, however the Homebrew versions of these tools caused the conflicts shown in the above question.