create-react-native-app: Cannot find module './build/Release/DTraceProviderBindings'

Description

Hi, Iโ€™m getting the following issue (screenshot attached too) after updating the CRNA app. I changed the version from the package.json and sdk version from app.json file. Whenever I run yarn start, it displays some error but the app works fine though.

Observed Behavior

{ 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> (/xxxx/xx/xx/xx/xx/xx/xx/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3) code: 'MODULE_NOT_FOUND' }

Environment

  • npm ls react-native-scripts: react-native-scripts@0.0.25
  • npm ls react-native: react-native@0.42.3
  • npm ls expo: expo@15.1.2
  • node -v: v7.4.0
  • npm -v: 4.0.5
  • yarn --version: 0.21.3
  • watchman version: 4.7.0

Also specify:

  1. Operating system: MacOS 10.12.4
  2. Phone/emulator/simulator & version: NA
screen shot 2017-03-29 at 11 07 50 am

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 24
  • Comments: 31 (7 by maintainers)

Most upvoted comments

Just to add my 2ยข, indeed, removing node_modules and using npm i instead of yarn solved it.

in our next release we will remove all dependencies on dtrace-provider, which should make all of these issues go away. sorry about this!

@wass3r do you have xcode installed? and if so, have you accepted the license agreement?

This is fixed now. We no longer depend on dtrace! ๐Ÿ˜ƒ

I encountered this and was able to fix it by using a Python version < 3.0.0, nuking node_modules and running yarn.

To see what the issue is for your system (or if the above did not solve the problem), run V=1 node node_modules/dtrace-provider/scripts/install.js. If it fails, it should tell you what needs to be fixed (wrong Python version or needs XCode license agreement).

The reason for the failure is that the dtrace-provider directory does not contain a build/Release/DTraceProviderBindings.node file. It doesnโ€™t contain this file because the scripts/install.js script failed to run.

Check your python version. dtrace-provider fails to install with any python version >= 3.0.0.

After

  • switching my python version to 2.7.13
  • nuking my node_modules folder
  • running npm i

I was able to run npm start successfully.

I had this error on an old create-react-native-app project and fixed it by running yarn upgrade.

However, I saw the following reference to @exponent instead of @expo. I nuked my node_modules and ran yarn, fixing that.

yarn upgrade v0.23.2
[1/4] ๐Ÿ”  Resolving packages...
warning react-native-scripts > xdl > @exponent/spawn-async@1.2.8: Please switch to @expo/spawn-async, the new name of this package. It's the same code with our new name.
warning react-native-scripts > xdl > @exponent/osascript > @exponent/spawn-async@1.2.8: Please switch to @expo/spawn-async, the new name of this package. It's the same code with our new name.
warning react-native-scripts > xdl > node-uuid@1.4.8: Use uuid module instead
warning react-native > xcode > node-uuid@1.4.7: Use uuid module instead
warning react-native-scripts > xdl > auth0-js > xtend > object-keys@0.4.0:
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Rebuilding all packages...
success Saved lockfile.

I had the same issue, so I followed @babenzele 's suggestion, removed the node_modules folder, and ran yarn install, the error was gone! Thanks @babenzele!

I followed the instructions in the Stack Overflow referenced above and it did not solve the issue for me.

  • React Native version:
yarn ls v0.17.10
โ””โ”€ react-native@0.44.3
  • Platform: IOS
  • Development Operating System: OS X, 10.11.6
  • Build tools: didnโ€™t explicitly use any, Xcode 8.2.1, 8C1002 is on system

@dikaiosune : Hereโ€™s the output: xdl@37.0.1