Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Permission error when running sudo turtle build:android. #370

Open
Rahul-Vignesh opened this issue Dec 21, 2021 · 4 comments
Open

Permission error when running sudo turtle build:android. #370

Rahul-Vignesh opened this issue Dec 21, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@Rahul-Vignesh
Copy link

New Issue Checklist

  • [ x] Updated turtle-cli to the latest version (yarn global add turtle-cli or npm install --global turtle-cli).
  • [x ] I read the Contribution Guidelines.
  • [ x] I read docs.expo.dev (Managed Workflow > Distributing Your App).
  • [ x] I searched for existing GitHub issues.
  • [ x] I enclosed the complete output when running turtle, including the stack trace and command used.

Issue Description

I'm getting an error when trying to build for android.

Command executed

sudo turtle build:android

Complete output when running turtle, including the stack trace and command used
 Dec 21 15:47:49 turtle[5232] WARN:  Skipping NDK installation
  platform: "android"
  buildPhase: "setting up environment"
Dec 21 15:47:49 turtle[5232] INFO:  shell app for SDK 44.0.0 doesn't exist, downloading...
  platform: "android"
  buildPhase: "setting up environment"
downloading [====================] 99% 0.2sDec 21 15:53:16 turtle[5232] INFO:  shell app has been downloaded
  platform: "android"
  buildPhase: "setting up environment"
Dec 21 15:53:16 turtle[5232] INFO:  extracting shell app (this may take a while)...
  platform: "android"
  buildPhase: "setting up environment"
Dec 21 15:53:42 turtle[5232] INFO:  shell app extracted
  platform: "android"
  buildPhase: "setting up environment"
Dec 21 15:53:42 turtle[5232] INFO:  installing dependencies in /Users/rahulvignesh/.turtle/workingdir/android/sdk44 directory...
  platform: "android"
  buildPhase: "setting up environment"
Dec 21 15:55:50 turtle[5232] INFO:  npm 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:55:50 turtle[5232] INFO:  WARN ERESOLVE overriding peer dependency
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:  npm
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:   WARN EBADENGINE Unsupported engine {
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:  npm WARN EBADENGINE   package: 'minifier@0.7.1',
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:  npm WARN EBADENGINE   required: { node: '~0.10.0 || ^0.12.0' },
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:  npm WARN EBADENGINE   current: { node: 'v16.13.0', npm: '8.1.0' }
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:56:07 turtle[5232] INFO:  npm WARN EBADENGINE }
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated har-validator@5.1.5: this library is no longer supported
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:   WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:   querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:30 turtle[5232] INFO:  npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  npm 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  WARN deprecated uuid@3.0.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  npm WARN
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:   deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:  npm WARN deprecated
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:31 turtle[5232] INFO:   request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:32 turtle[5232] INFO:  npm WARN
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:32 turtle[5232] INFO:   deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:32 turtle[5232] INFO:  npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:32 turtle[5232] INFO:  npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:33 turtle[5232] INFO:  npm WARN 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:33 turtle[5232] INFO:  deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:33 turtle[5232] INFO:  npm WARN deprecated minifier@0.7.1: please don't use. see readme (https://github.com/fizker/minifier) for details
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:35 turtle[5232] INFO:  npm WARN
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:35 turtle[5232] INFO:   deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:37 turtle[5232] INFO:  npm WARN
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:37 turtle[5232] INFO:   deprecated processing-js@1.6.6: This project has been archived. Please use p5js instead.
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! code 127
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! path /Users/rahulvignesh/.turtle/workingdir/android/sdk44/packages/expo-application
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR!
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:   command failed
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! command sh -c expo-module prepare
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! sh: expo-module: command not found
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR! A complete log of this run can be found in:
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] INFO:  npm ERR!     /Users/rahulvignesh/.npm/_logs/2021-12-21T10_27_40_766Z-debug.log
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Dec 21 15:57:40 turtle[5232] ERROR: Failed to build standalone app
  err: Error: npm exited with non-zero code: 127
      at ChildProcess.completionListener (/usr/local/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
      at Object.onceWrapper (node:events:510:26)
      at ChildProcess.emit (node:events:390:28)
      at ChildProcess.emit (node:domain:475:12)
      at maybeClose (node:internal/child_process:1064:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
      ...
      at spawnAsync (/usr/local/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
      at Object.spawnAsyncThrowError (/@expo/xdl@59.1.7/src/detach/ExponentTools.ts:111:19)
      at _installNodeModules (/usr/local/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:106:23)
      at _shellAppPostDownloadAction (/usr/local/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:91:5)
      at Object.ensureShellAppIsPresent (/usr/local/lib/node_modules/turtle-cli/src/bin/setup/utils/common.ts:40:5)
      at Object.setup [as default] (/usr/local/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:60:5)
      at Object.setup [as default] (/usr/local/lib/node_modules/turtle-cli/src/bin/setup/setup.ts:15:12)
      at /usr/local/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:79:7
      at Command. (/usr/local/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
  platform: "android"

Environment

 Expo CLI 5.0.1 environment info:
    System:
      OS: macOS 12.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.13.0 - /usr/local/bin/node
      npm: 8.1.0 - /usr/local/bin/npm
    SDKs:
      Android SDK:
        API Levels: 30, 32
        Build Tools: 32.0.0
        System Images: android-31 | Google APIs ARM 64 v8a, android-32 | Google APIs ARM 64 v8a
    IDEs:
      Android Studio: 2020.3 AI-203.7717.56.2031.7935034
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      expo: ^44.0.0 => 44.0.0 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.64.3 => 0.64.3 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      expo-cli: 5.0.1
    Expo Workflow: managed 
@Rahul-Vignesh Rahul-Vignesh added the bug Something isn't working label Dec 21, 2021
@wkozyra95
Copy link
Contributor

do not run with sudo

@AngelDevs
Copy link

i have this problem too, did you find a way to solve it?

@Rahul-Vignesh
Copy link
Author

i have this problem too, did you find a way to solve it?

not yet, im just using expo build command.

@AngelDevs
Copy link

Hi, i solved it.

I believe the problem was because i installed expo and turtle cli with sudo, this apparently causes permission errors.

What i did was uninstall NPM and Node and all the cache from both, i just cleaned everything and installed NVM instead of Node and then with NVM i installed Node 16.3.1 and NPM 8.1.2.

I didn't need to use sudo at all and everything worked correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants