描述
在使用最新版本创建应用程序时遇到TypeError。
重现步骤
- npx react-native@latest init MyProject
React Native版本
0.74.0
受影响的平台
运行时 - Android,运行时 - iOS
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
堆栈跟踪或日志
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>)
可复现问题
https://github.com/facebook/react-native
截图和视频
- 无响应*
8条答案
按热度按时间rggaifut1#
7cjasjjr2#
请提供一个有效的复现@kuldipopenxcell
cl25kdpy3#
我遇到了同样的问题。以下是我在本地遇到的情况以及如何解决的。
npx react-native@latest init MyProject
npx react-native@latest init MyProject
并成功完成im9ewurl4#
@francisace 对于我来说工作正常。
谢谢
bybem2ql5#
nano ~/.yarnrc
以打开文件。"ces"
。Ctrl+X
退出,然后按Y
确认更改并按 Enter。wecizke36#
我确认我遇到了这个问题...为什么每次我创建一个新项目时都会有一个新的错误。react-native真是令人惊讶。
13z8s7eq7#
nano ~/.yarnrc
以打开文件。"ces"
。Ctrl+X
退出,然后按Y
确认更改并按 Enter。谢谢,这个方法对我有效
vuktfyat8#
nano ~/.yarnrc
以打开文件。"ces"
。Ctrl+X
退出,然后按Y
确认更改并按 Enter。感谢 @virenradadiya
它对我有效