Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create new RN 0.72 project with Node 16 #38298

Closed
jonthysell opened this issue Jul 11, 2023 · 5 comments
Closed

Unable to create new RN 0.72 project with Node 16 #38298

jonthysell opened this issue Jul 11, 2023 · 5 comments

Comments

@jonthysell
Copy link
Contributor

Description

RN 0.72 requires Node >=16. However it looks like the dependencies of the init command (metro-config) were updated to require Node 18 as RN > 0.72 will require Node 18.

Error:

√ Downloading template
√ Copying template
√ Processing template
× Installing dependencies
error Error: Command failed: yarn install
warning react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro > metro-minify-uglify > uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning @react-native/metro-config > metro-config > metro > metro-minify-uglify > uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning @types/metro-config@0.76.3: This is a stub types definition. metro-config provides its own type definitions, so you do not need this installed.
error metro-config@0.77.0: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.18.1"
error Found incompatible module.
yarn install v1.22.19
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

React Native Version

0.72.0

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.25393
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Memory: 3.31 GB / 15.84 GB
Binaries:
Node: 16.18.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.16299.0, 10.0.18362.0, 10.0.19041.0, 10.0.22000.0, 10.0.22621.0
IDEs:
Android Studio: Not Found
Visual Studio: 16.11.33801.447 (Visual Studio Enterprise 2019), 17.6.33801.468 (Visual Studio Enterprise 2022)
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Run npx --yes react-native init testcli --template react-native@^0.72.0.

Snack, code example, screenshot, or link to a repository

image
@github-actions
Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.72.2. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@jonthysell
Copy link
Contributor Author

Sorry, this does not appear to repro with npx --yes react-native@0.72.2 init testcli --template react-native@0.72.2.

@fortmarek
Copy link
Contributor

npx react-native runs your locally cached version of the RN CLI. It's better to always run npx react-native@latest. Can we close this issue?

@cortinico
Copy link
Contributor

Can we close this issue?

Yes, this was fixed in 0.72.2. It was fixed by the removal of @types/metro-config.

@minhthuhai
Copy link

upgrade node version to 18. so i solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants