6

I have installed expo-cli and set the env variable. It gives this error:

The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo). Uncaught Error Error: EPERM: operation not permitted, mkdir 'C:\Users\a.expo'

Node Version: v18.12.1 npm version: 9.1.3

Anosha Sheikh
  • 61
  • 1
  • 1
  • 4

4 Answers4

10

I got the same error after installing a package. After some digging I noticed that the version system has expo dependencies "^1.0.0". As a result, I updated it as " npx expo upgrade " and my application worked. before npx expo upgrade

5

I had the same problem and I used "npx expo-cli upgrade" command insode of the project directory and my problem solved.

1

I think you should start with npx expo start.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
0

In case anyone is having a similar problem, noticed that using an outdated CLI (the legacy cli) was causing issues when some of the commands in the expo documentation were not working for me. For instance, I tried to run npx expo customize metro.config.js and the command was not recognized.

I attempted to fix it using the first answer in this post, and when running npx expo upgrade I got the following error:

Error: yarnpkg exited with non-zero code: 1
    at ChildProcess.completionListener (/opt/homebrew/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
    ...
    at spawnAsync (/opt/homebrew/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
    at YarnPackageManager._runAsync (/opt/homebrew/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:314:31)
    at YarnPackageManager.addWithParametersAsync (/opt/homebrew/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:259:16)
    at YarnPackageManager.addAsync (/opt/homebrew/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:263:5)
    at upgradeAsync (/opt/homebrew/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:496:7)
    at actionAsync (/opt/homebrew/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:42:3)

I had to first run yarn upgrade expo, and then npx expo upgrade and it seems to have fixed the expo CLI error. I am able to run the initial npx expo customize metro.config.js command successfully as well.