microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.93k stars 1.46k forks source link

build failing using latest freshly installed react native 0.56.0 #1362

Closed yeomann closed 6 years ago

yeomann commented 6 years ago

Steps to Reproduce

  1. react-native init Project_Name
  2. yarn install appcenter appcenter-analytics appcenter-crashes
  3. react-native link

Expected Behavior

build to happen after I selected bitbucket git repo

Actual Behavior

[1/4] Resolving packages...
[2/4] Fetching packages...
error react-native@0.56.0: The engine "node" is incompatible with this module. Expected version ">=8".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
##[error]/bin/sh failed with return code: 1
##[error]/bin/sh failed with error: /bin/sh failed with return code: 1
  STACK TRACE AND/OR SCREENSHOTS
screen shot 2018-07-26 at 19 40 24

Reproducible Demo

Here's the repo for you https://bitbucket.org/xeront/test-upgrade

Environment


  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
      Memory: 1.10 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 9.11.1 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.2.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0
        API Levels: 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1
      react-native: 0.56.0 => 0.56.0
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
alexandergoncharov-zz commented 6 years ago

Hi @yeomann , Thanks for reporting!

As it is issue for appcenter-analytics and appcenter-crashes I think that it will be better if you will report this issue to according repo: https://github.com/Microsoft/AppCenter-SDK-React-Native It will be faster to get response for you in those repo.

Please let me know if you have any questions.

Thanks, Alexander

yeomann commented 6 years ago

thanks @alexandergoncharov I think it because React-native 0.56.0 uses node >= 8 and appcenter is still on v6 anyways I'll close for now.

theashishranjan commented 6 years ago

@yeomann You can solve this by adding a Post Clone script in your repo to install your desired node version.

https://intercom.help/appcenter/build/react-native-builds-fail-with-the-engine-node-is-incompatible-with-this-module-expected-version-xxx-error-found-incompatible-module?

You can read about post clone script here: https://docs.microsoft.com/en-us/appcenter/build/custom/scripts/#post-clone

n1ru4l commented 6 years ago

@theashishranjan @yeomann You could also use the .yarnrc file.

--install.ignore-engines true

Edit: this does not work since the react-native cli uses node 8 features.

yeomann commented 6 years ago

ok thanks, I solved the issue via post-clone script.

n1ru4l commented 6 years ago

The requirements of the build machines list node 6 and 8 installed (https://docs.microsoft.com/en-us/appcenter/build/software).

Any idea how to use the preinstalled version 8 ?

freakyfriday commented 6 years ago

@n1ru4l the only way to do it currently is to follow the instructions @theashishranjan described. Remember to do a "re-save" on the Build Configuration for App Center to pick it up again. I missed this step and couldn't work out why it was working.