Error on install of turtle-cli

expo diagnostics:

Expo CLI 4.5.2 environment info:
System:
OS: macOS 11.4
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - /opt/homebrew/opt/node@14/bin/node
npm: 6.14.13 - /opt/homebrew/opt/node@14/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
IDEs:
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
npmGlobalPackages:
expo-cli: 4.5.2
Expo Workflow: managed

System: MacBook Air M1 2020, 16GB

Command:

npm i -g turtle-cli

Error during install as of below.
All help and comments appreciated
Regards, /ben

sharp@0.24.1 install /opt/homebrew/lib/node_modules/turtle-cli/node_modules/sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.0/libvips-8.9.0-darwin-arm64v8.tar.gz
ERR! sharp Prebuilt libvips 8.9.0 binaries are not yet available for darwin-arm64v8
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
…/src/common.cc:25:10: fatal error: ‘vips/vips8’ file not found
#include <vips/vips8>
**^~~~~~~~~~~~**
1 error generated.
make: *** [Release/obj.target/sharp/src/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/homebrew/Cellar/node@14/14.17.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command “/opt/homebrew/Cellar/node@14/14.17.0/bin/node” “/opt/homebrew/Cellar/node@14/14.17.0/lib/node_odules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /opt/homebrew/lib/node_modules/turtle-cli/node_modules/sharp
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN @pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of react-refresh@^0.8.2 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.24.1 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.24.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ben/.npm/_logs/2021-06-06T08_32_46_684Z-debug.log

Hey @ben.archer2691, it looks like this is related to prebuilts for M1 Macs. Let me route this internally to see what the best course of action is and we’ll follow up here.

Cheers,
Adam

Thank you so much for your attention.

/Ben

Can you test turtle-cli@0.21.9-alpha.0 ?

npm i -g turtle-cli@0.21.9-alpha.0

Turtle now installs. Progress :slight_smile:

Executed

turtle setup:android

with result

Jun 8 17:07:15 turtle[13175] INFO: Downloading Android SDK
platform: “android”
buildPhase: “setting up environment”
downloading [====================] 97% 0.3sJun 8 17:07:30 turtle[13175] INFO: Decompressing Android SDK
platform: “android”
buildPhase: “setting up environment”
Jun 8 17:07:32 turtle[13175] INFO: Configuring Android SDK, this may take a while
platform: “android”
buildPhase: “setting up environment”
Jun 8 17:08:54 turtle[13175] INFO: Warning: Failed to find package ndk;17.2.4988734
platform: “android”
buildPhase: “setting up environment”
source: “stderr”
Jun 8 17:08:55 turtle[13175] ERROR: Failed to setup environment for android builds
err: Error: ./configureAndroidSdk.sh exited with non-zero code: 1
at ChildProcess.completionListener (/opt/homebrew/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:483:26)
at ChildProcess.emit (events.js:376:20)
at ChildProcess.emit (domain.js:470:12)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

at spawnAsync (/opt/homebrew/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at Object.spawnAsyncThrowError (/@expo/xdl@59.1.0/src/detach/ExponentTools.ts:111:19)
at _configureSdk (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:54:23)
at Object.ensureAndroidSDKIsPresent [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:34:7)
at prepareAndroidEnv (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:70:21)
at Object.setup [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:58:3)
at Object.setup [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/setup.ts:15:12)
at setupAction (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:33:5)
at /opt/homebrew/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:22:40
at Command. (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
platform: “android”

Regards,
/ben

I’ll check tomorrow what android ndk have support for m1 mac and try to prepare new version, but I’m not sure if it’s the last part necessary to support that architecture.

I suggest using rosetta in a meantime.

Great & thanks!

/ben

Hi again!

Any news on this one?

Kind regards,
/ben

hi there,

there is a pr open to resolve this: update sharp by wkozyra95 · Pull Request #319 · expo/turtle · GitHub - you can follow this pr and the repo to see when it is released

@ben.archer2691 We had some unrelated issues with a build service and I didn’t have time to prepare next version.

The link that @notbrent mentioned won’t work because of incompatible ndk

1 Like

Thank you for your kind update.

Best regards,
/ben

Can you try turtle-cli@0.21.9-alpha.2?

execute

npm uninstall -g turtle-cli
npm i -g turtle-cli@0.21.9-alpha.2

Installs without issues (some warnings though, pls let me know if you need these)

turtle setup:android

Result

Jun 11 13:28:36 turtle[4410] INFO: Downloading Android SDK
platform: “android”
buildPhase: “setting up environment”
downloading [=================== ] 95% 0.7sJun 11 13:28:50 turtle[4410] INFO: Decompressing Android SDK
platform: “android”
buildPhase: “setting up environment”
Jun 11 13:28:52 turtle[4410] INFO: Configuring Android SDK, this may take a while
platform: “android”
buildPhase: “setting up environment”
Jun 11 13:30:14 turtle[4410] INFO: Warning: Failed to find package ndk;21.4.7075529
platform: “android”
buildPhase: “setting up environment”
source: “stderr”
Jun 11 13:30:15 turtle[4410] ERROR: Failed to setup environment for android builds
err: Error: ./configureAndroidSdk.sh exited with non-zero code: 1
at ChildProcess.completionListener (/opt/homebrew/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:483:26)
at ChildProcess.emit (events.js:376:20)
at ChildProcess.emit (domain.js:470:12)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

at spawnAsync (/opt/homebrew/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at Object.spawnAsyncThrowError (/@expo/xdl@59.1.0/src/detach/ExponentTools.ts:111:19)
at _configureSdk (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:54:23)
at Object.ensureAndroidSDKIsPresent [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:34:7)
at prepareAndroidEnv (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:70:21)
at Object.setup [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:58:3)
at Object.setup [as default] (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/setup/setup.ts:15:12)
at setupAction (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:33:5)
at /opt/homebrew/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:22:40
at Command. (/opt/homebrew/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
platform: “android”

Best regards,
/ben

Small chance that one of those will work

  • 0.21.9-alpha.3 latest ndk
  • 0.21.9-alpha.4 no ndk (binaries might be a bit bigger, but with aab it shouldn’t matter)

make sure to delete ~/.turtle directory when switching between those versions

I hoped that upgrading ndk will work but it seems m1 support might require upgrade of android toolchain which significantly evolved since we last updated it. So if above solutions won’t solve that, a proper fix would require a lot of work.

I’ll take it up internally if we want to support it, but most likely decision will be no to do that. turtle-cli is going to be deprecated when we switch to EAS (few more sdks will still be supported), so we don’t really want to work on that if it’s not critical issue (it’s not considered critical, because it should still work for you under rosetta).

rm -rf ~/.turtle
npm uninstall -g turtle-cli
npm i -g turtle-cli@0.21.9-alpha.4
turtle setup:android

This works!
I have now successfully locally built a small sample android application and installed/run it on actual hardware, without issues.

Java version (for your reference):

ben@ben expo-apps % java -version
openjdk version “1.8.0_292”
OpenJDK Runtime Environment (Zulu 8.54.0.21-CA-macos-aarch64) (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (Zulu 8.54.0.21-CA-macos-aarch64) (build 25.292-b10, mixed mode)

Also tested to install turtle-cli@0.21.9-alpha.3, but it failed at the same point as turtle-cli@0.21.9-alpha.2

Again, thanks for all your help & I wish you a fantastic weekend,
/ben