facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.35k stars 24.12k forks source link

TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1713956001921 nodeLinker node-modules ces nodeLinker node-modules' #44249

Open kuldipopenxcell opened 3 months ago

kuldipopenxcell commented 3 months ago

Description

Got TypeError while creating app with latest version.

Steps to reproduce

  1. npx react-native@latest init MyProject

React Native Version

0.74.0

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.3.1
  CPU: (8) arm64 Apple M2
  Memory: 82.64 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.5.0
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0
    wanted: 0.74.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

TypeError: Cannot create property 'lastUpdateCheck' on string 'lastUpdateCheck 1713956001921 nodeLinker node-modules ces nodeLinker node-modules'
    at /Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:100249:32
    at Generator.next (<anonymous>)
    at step (/Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:310:30)
    at /Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:328:14
    at new Promise (<anonymous>)
    at new F (/Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:25832:28)
    at /Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:307:12
    at YarnRegistry.saveHomeConfig (/Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:100253:7)
    at /Users/kuldip/Documents/RN-Projects/Chat-RN/FirebaseChat/.yarn/releases/yarn-1.22.22.cjs:7440:38
    at Generator.next (<anonymous>)

Reproducer

https://github.com/facebook/react-native

Screenshots and Videos

No response

github-actions[bot] commented 3 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
cortinico commented 3 months ago

Pleasae provide a valid repro @kuldipopenxcell

francisace commented 3 months ago

I ran into the same issue. Here's what happened on my end and how I fixed it locally.

  1. Delete ~/.yarnrc
  2. Ran npx react-native@latest init MyProject
  3. It fails with the error above.
  4. There appears to be a rogue "ces" string in the generated ~/.yarnrc
  5. I removed the "ces"
  6. Re-ran npx react-native@latest init MyProject and it completed successfully
kuldipopenxcell commented 3 months ago

@francisace works fine for me. Thanks

virenradadiya commented 2 months ago
  1. Open your terminal and enter nano ~/.yarnrc to open the file.
  2. Remove "ces" using the arrow keys.
  3. Press Ctrl+X to exit, then press Y to confirm the changes and hit Enter.
vricosti commented 2 months ago

I confirm I had this issue ... why everytime I create a new project I have a new error. react-native is so surprising.

urgenmagger commented 2 months ago
  1. Open your terminal and enter nano ~/.yarnrc to open the file.
  2. Remove "ces" using the arrow keys.
  3. Press Ctrl+X to exit, then press Y to confirm the changes and hit Enter.

Thank you, this method works for me

SafiDS commented 1 month ago
  1. Open your terminal and enter nano ~/.yarnrc to open the file.
  2. Remove "ces" using the arrow keys.
  3. Press Ctrl+X to exit, then press Y to confirm the changes and hit Enter.

Thanks @virenradadiya It works for me