The legacy expo-cli does not support Node +17
Asked Answered
H

7

15

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

Hexapartite answered 1/2, 2023 at 18:8 Comment(0)
H
12

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

Haiku answered 5/2, 2023 at 21:5 Comment(0)
P
7

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

Papist answered 9/3, 2023 at 19:32 Comment(0)
S
2

I encountered the same problem -

$ npm install --global expo-cli // 1st command

$ expo init demo_app // 2nd command
WARNING: The legacy expo-cli does not support Node +17. Migrate to the new local Expo CLI: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421.

[14:38:50]

Migrate to using:

› npx create-expo-app --template

[14:38:51] Input is required, but Expo CLI is in non-interactive mode.

--template: argument is required in non-interactive mode. Valid choices are: "blank", "tabs", "bare-minimum" or any custom template (name of npm package).
  • Node version - v18.17.1
  • NPM version - 9.8.1

Steps to fix this issue -

1 - uninstall expo-cli:

npm uninstall --global expo-cli

2 - Install Expo CLI to latest version:

npm install --global expo-cli

3 - Create a New Expo TypeScript Project:

npx create-expo-app demo_app --template expo-template-blank-typescript

4 - Navigate to Your Project:

cd demo_app

5 - Install react-native-web@~0.19.6:

npm install react-native-web@~0.19.6

6 - Install [email protected]:

npm install [email protected]

7 - Install @expo/webpack-config@^19.0.0:

npm install @expo/webpack-config@^19.0.0

8 - Run project:

npm run web

enter image description here

Synecology answered 19/9, 2023 at 10:20 Comment(1)
there is no @expo-cli instead use npm i @expo/cliUrdar
R
1

I think you should start with npx expo start.

Rosemaryrosemond answered 1/2, 2023 at 18:24 Comment(1)
This does not work for me.Spinning
B
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.

Bagnio answered 17/3, 2023 at 15:35 Comment(0)
D
0

For my part, it's simple. I simply cloned my project and launched: "npm install" then: "npx expo start"

Diversified answered 20/2 at 11:37 Comment(0)
P
0

Expo Upgrade

This will Enable and then the required SDK will get installed

Partition answered 5/4 at 6:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.