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 #39692

Closed
mfazekas opened this issue Sep 27, 2023 · 6 comments
Closed

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

mfazekas opened this issue Sep 27, 2023 · 6 comments
Assignees
Labels
Needs: React Native Team Attention Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@mfazekas
Copy link
Contributor

mfazekas commented Sep 27, 2023

Description

% node --version
v16.20.1

%npx --yes react-native@0.72.5 init testcli --template react-native@0.72.5
...
error @react-native/normalize-colors@0.73.1: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.20.1"
error Found incompatible module.
% yarn why @react-native/normalize-colors
yarn why v1.22.19
[1/4] 🤔  Why do we have the module "@react-native/normalize-colors"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@react-native/normalize-colors@0.72.0"
info Reasons this module exists
   - "react-native" depends on it
   - Hoisted from "react-native#@react-native#normalize-colors"
info Disk size without dependencies: "24KB"
info Disk size with unique dependencies: "24KB"
info Disk size with transitive dependencies: "24KB"
info Number of shared dependencies: 0
=> Found "deprecated-react-native-prop-types#@react-native/normalize-colors@0.73.1"
info This module exists because "react-native#deprecated-react-native-prop-types" depends on it.
info Disk size without dependencies: "28KB"
info Disk size with unique dependencies: "28KB"
info Disk size with transitive dependencies: "28KB"
info Number of shared dependencies: 0
✨  Done in 0.18s.

Looks like the issue was caused by recent publish of @react-native/normalize-colors@0.73.1
https://github.com/facebook/react-native/tree/main/packages/normalize-color

React Native Version

0.72.5

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 13.6
  CPU: (12) arm64 Apple M2 Max
  Memory: 703.91 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.20.1
    path: ~/.nvm/versions/node/v16.20.1/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v16.20.1/bin/yarn
  npm:
    version: 9.7.2
    path: ~/.nvm/versions/node/v16.20.1/bin/npm
  Watchman:
    version: 2023.09.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/boga/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 15.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.7.8
    path: /Users/boga/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.5
    wanted: 0.72.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Steps to reproduce

% node --version
v16.20.1

npx --yes react-native@0.72.5 init testcli --template react-native@0.72.5

Snack, screenshot, or link to a repository

See also #38298

@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Sep 27, 2023
@github-actions

This comment was marked as resolved.

@duasfh
Copy link

duasfh commented Sep 27, 2023

Is it possible for your project to update node version?
If not, you probably could try to add "@react-native/normalize-colors" to the package's "overrides" list with the previous version.
Current version 0.73.1 seems to be pushed yesterday.

But if possible, probably it's cleaner to update node version

@mfazekas
Copy link
Contributor Author

@duasfh thanks, I'm personally not affected, this was an issue we saw on our CI, we've updated CI to node 18, so we're fine. But I don't think it was an intended/documented change that rn 0.72.* requires node 18 now.

@Definitely-Not-Vlad
Copy link

Definitely-Not-Vlad commented Sep 27, 2023

Considering the latest stable RN includes the following in package.json:

"engines": {
  "node": ">=16"
}

I would kindly ask for a RN side resolution to this. Not sure if this is an acceptable approach, but it comes to mind; publishing @react-native/normalize-colors 0.73.0 as 0.73.2, then publishing 0.73.1 as 0.74.0, considering it's a breaking change due to its change of Node minimum version requirements.

For the time being I'm resolving this on my side using:

"resolutions": {
  "@react-native/normalize-colors": "0.73.0"
}

In my package.json, but I would much prefer not having to add this.

@cortinico cortinico added Needs: React Native Team Attention and removed Needs: Triage 🔍 Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Sep 27, 2023
@cortinico
Copy link
Contributor

Thanks for flagging this @mfazekas, we're currently investigating what's the best resolution for this problem. As you mentioned, setting the resolutions for "@react-native/normalize-colors": "0.73.0" is a valid workaround as that version doesn't contain the engines directive.

@cortinico
Copy link
Contributor

Closing as per #39698
We published @react-native/normalize-colors version 0.73.2 which fixes this issue

@cortinico cortinico added the Resolution: Fixed A PR that fixes this issue has been merged. label Sep 27, 2023
facebook-github-bot pushed a commit that referenced this issue Oct 14, 2023
Summary:
To address the root cause of a recurring issue (#40797, #39692) where breaking changes to `react-native/normalize-colors` would be pulled into old versions of `deprecated-react-native-prop-types`, we recently change the dependency in the latter to use a semver range (facebook/react-native-deprecated-modules#27, #40869).

For CI, we generally force `react-native/*` to be resolved only from Verdaccio locally published packages - ie, the current versions at source. The source version (currently `0.74.1`) isn't semver-compatible with `deprecated-react-native-prop-types`'s dependency (`^0.73.0`), so `npm install` was failing in CI with "no package found". We should be getting `0.73.2` from the public registry in this case.

This restores a previous workaround added in #34571 but not updated since facebook/react-native-deprecated-modules#11 meant the dependency was now on the pluralised package. We have no dependency on the old non-plural package any more.

## Changelog:

[INTERNAL] [FIXED] - CI/Verdaccio: Proxy `react-native/normalize-colors` from NPM for the `deprecated-react-native-prop-types` dependency.

Pull Request resolved: #40971

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D50298291

Pulled By: robhogan

fbshipit-source-id: 4bf6503108335ffa52654346d1874c217071ff91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: React Native Team Attention Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests

6 participants