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

yarnpkg add --dev --exact react-native-scripts failed #61

Closed
peterpme opened this issue Mar 14, 2017 · 9 comments
Closed

yarnpkg add --dev --exact react-native-scripts failed #61

peterpme opened this issue Mar 14, 2017 · 9 comments

Comments

@peterpme
Copy link

peterpme commented Mar 14, 2017

yarn global add create-react-native-app
create-react-native-app funstuff
node 7.7.0

Creating a new React Native app in /Users/peter/Sites/crna/funstuff.

Installing packages. This might take a couple minutes.
Installing react-native-scripts...

yarn add v0.21.3
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning react-native-scripts > xdl > node-uuid@1.4.7: use uuid module instead
warning react-native-scripts > xdl > @exponent/ngrok > 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] 📃  Building fresh packages...
[1/5] ⢀ @exponent/ngrok: ngrok - downloading binary https://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-darwin-amd64.zip ...
[2/5] ⢀ dtrace-provider
[3/5] ⢀ ref:          ^
[4/5] ⢀ runas:          ^
error /Users/peter/Sites/crna/funstuff/node_modules/ref: Command failed.
Exit code: 1
Command: sh
Arguments: -c node-gyp rebuild
Directory: /Users/peter/Sites/crna/funstuff/node_modules/ref
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.5.0
gyp info using node@7.7.0 | darwin | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/local/Cellar/yarn/0.21.3/libexec/lib/node_modules/yarn/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/peter/Sites/crna/funstuff/node_modules/ref/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/yarn/0.21.3/libexec/lib/node_modules/yarn/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/peter/.node-gyp/7.7.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/peter/.node-gyp/7.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/yarn/0.21.3/libexec/lib/node_modules/yarn/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/peter/Sites/crna/funstuff/node_modules/ref',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/binding/src/binding.o
In file included from ../src/binding.cc:5:
/Users/peter/.node-gyp/7.7.0/include/node/node.h:44:10: fatal error: 'tracing/trace_event.h' file not found
#include "tracing/trace_event.h"
         ^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/yarn/0.21.3/libexec/lib/node_modules/yarn/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.4.0
gyp ERR! command "/Users/peter/.nvm/versions/node/v7.7.0/bin/node" "/usr/local/Cellar/yarn/0.21.3/libexec/lib/node_modules/yarn/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/peter/Sites/crna/funstuff/node_modules/ref
gyp ERR! node -v v7.7.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
`yarnpkg add --dev --exact react-native-scripts` failed
@peterpme
Copy link
Author

For those of you running Node 7.7.0, please upgrade to 7.7.2 and this will be resolved. See nodejs/node#11628

@ganjahnavarro
Copy link

Hi,

After updating my node version to 7.7.2. I'm still experiencing the same error. Not sure if it's any use but I already tried 'npm cache clean' and 'yarn cache clean'. Any idea what might be the cause would help, thanks.

yarn version: 0.21.3
node version: 7.7.2

@anp
Copy link
Contributor

anp commented Mar 14, 2017

@ganjahnavarro I'm looking into this this morning, I think that there was a behavioral change in yarn that I must have missed in my testing. I'm hoping to have a release out later today which resolves the issue.

@anp anp reopened this Mar 14, 2017
@peterpme
Copy link
Author

Hey @ganjahnavarro,

Make sure you're actually using 7.7.2 right before you're running the command to make sure (sanity check).

If you've been using yarn, you might have some luck re-linking your global packages using something like this (easiest way): https://github.com/bradley-curran/fix-yarn-global-packages

@anp
Copy link
Contributor

anp commented Mar 14, 2017

I'd also recommend trying yarn cache clean. Need to look into some of the underlying issues more though.

@ganjahnavarro
Copy link

ganjahnavarro commented Mar 14, 2017

@dikaiosune

I already tried yarn cache clean before hand. I also tried using https://github.com/bradley-curran/fix-yarn-global-packages but it doesn't fix the issue.

By the way, I tried uninstalling yarn temporarily to force the creation of project to use npm instead of yarn and then it works. So it is surely a yarn issue.

Thanks a lot!

@anp
Copy link
Contributor

anp commented Mar 14, 2017

Excellent! Glad it worked for you. I need to force yarn to treat optional dependencies as OK to fail.

@anp anp closed this as completed Mar 14, 2017
@meghnakatkamwar
Copy link

I am still facing this issue, is uninstalling yarn the only option?

@ide
Copy link
Member

ide commented Jul 12, 2018

This issue is pretty old so the root cause might be different. If you don't want to debug & diagnose it, you could try expo-cli (https://blog.expo.io/announcing-expo-dev-tools-beta-c252cbeccb36) and seeing if that works better for you.

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

5 participants