0

I just cloned my Expo project to my new macbook. I have installed the packages and expo global using yarn, but no luck to run expo start. The Error message below:

(node:39137) UnhandledPromiseRejectionWarning: /Users/hurraychak/.config/yarn/global/node_modules/@expo/cli/build/src/api/rest/client.js:28
    name = "ApiV2Error";
         ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/hurraychak/.config/yarn/global/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
(node:39137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:39137) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:39137) UnhandledPromiseRejectionWarning: /Users/hurraychak/.config/yarn/global/node_modules/@expo/cli/build/src/api/rest/client.js:28
    name = "ApiV2Error";
         ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/hurraychak/.config/yarn/global/node_modules/@expo/cli/build/src/api/getExpoGoIntermediateCertificate.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
(node:39137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)

I can't find anyone discussing this error on the internet. I found this error message being displayed while running expo. Please help me to solve this with thanks!

  • Wich version of `expo` are you using? Also, to start your app in expo you must run `npx expo start` instead of just `expo start`. You can find more about this [here](https://blog.expo.dev/the-new-expo-cli-f4250d8e3421) – NoNam4 Aug 15 '23 at 16:43
  • you may refer below where they have similar kind of issues with a specific expo version https://stackoverflow.com/questions/72784708/expo-error-on-launching-the-app-apiv2error-account-not-found – Hrusikesh Aug 15 '23 at 18:25
  • "expo": "^49.0.7" I am using `yarn expo start`, and tried `yarn expo logout`. Both of them are not working because it's not able to run `expo` – HurrayChak Aug 16 '23 at 07:00
  • It shows 0.10.11 when I run `expo --version`. – HurrayChak Aug 16 '23 at 07:12

1 Answers1

0

I have fixed the issue by running nvm use18 to use the latest node version.

Previously, I tried upgrading node by both command and downloading but the system is still using node of version 10.xx.xx and I don't realize that.