react-native upgrade returning 'toLowerCase' of undefined - react-native

I'm trying to update my react native to latest version. I run the command: react-native upgrade --verbose
However, it is returning:
info No version passed. Fetching latest...
info Fetching diff between v0.59.8 and v0.60.5...
error Cannot read property 'toLowerCase' of undefined
debug TypeError: Cannot read property 'toLowerCase' of undefined
at getPatch (/Users/myUser/Documents/React Native/myApp/node_modules/#react-native-community/cli/build/commands/upgrade/upgrade.js:109:121)
at process._tickCallback (internal/process/next_tick.js:68:7)
How can I upgrade react native?

Add the name attribute in your package.json file. this will resolve the issue

Related

Unable to run npx react-native init

I keep getting this error:
✖ Installing Bundler
error /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users(my path here)/ in PATH, mode 040777
✖ Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
at createFromTemplate
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.initialize [as func]
Ive spent too long on this, someone please help

React Native Expo Error downloading and extracting template package: TypeError: Cannot read properties of null (reading '0')

I am getting started with react native using expo-cli version 5.4.9 on ubuntu OS.
Successfully installed expo but getting this error on initializing new app
i has this same problem, reinstall npm and nodejs for update new version, after this resolved.

nom galio-framework missing ./fonts/galio.ttf

I'm using galio-framework in my react native project. I installed galio-framewor using npm i galio-framework https://www.npmjs.com/package/galio-framework.
However, when I run my expo project, it returns the warning:
[Unhandled promise rejection: Error: Could not download from './fonts/galio.ttf']
The icon/fonts are not being loaded in my project. How can I install galio.ttf?
Thanks

TypeError: Cannot read property 'replace' of undefined at Module.extractRequires [as _extractor]

Description
I recently upgraded my react-native package and some others in my package.json to the latest release. Each time I try to compile me project, I run into a this error in the terminal:
TypeError: Cannot read property 'replace' of undefined
at Module.extractRequires [as _extractor] (PATH_TO_PROJECT/node_modules/react-native/packager/react-packager/src/node-haste/lib/extractRequires.js:31:10)
at codePromise.then.result (PATH_TO_PROJECT/node_modules/react-native/packager/react-packager/src/node-haste/Module.js:209:49)
at tryCallOne (PATH_TO_PROJECT/node_modules/promise/lib/core.js:37:12)
at PATH_TO_PROJECT/node_modules/promise/lib/core.js:123:15
at flush (PATH_TO_PROJECT/node_modules/asap/raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
The simulator throws the following error:
{"type":"InternalError","message":"react-packager has encountered an internal error, please check your terminal error output for more details"}
I can't tell if this is a source code problem, or if I messed up somehow in updating my npm packages.
Additional Information
React Native version: 0.39.2
Platform: iOS
Operating System: MacOS

using pusher npm in reactnative app

I'm trying to get a basic reactnative app with chat feature going. Found a pusher npm on https://www.npmjs.com/package/pusher
Did install the module to the project with:
npm install pusher --save
As soon as I add to a react component following line of code
var Pusher = require('pusher');
the xcode project stops compiling with following stack trace:
bundle: Created ReactPackager
uncaught error Error: UnableToResolveError: Unable to resolve module crypto from /Users/dmitry/hacks/tentags/TenTags/node_modules/request/lib/helpers.js: Invalid directory /Users/node_modules/crypto
at ResolutionRequest.js:356:15
at tryCallOne (/Users/dmitry/hacks/tentags/TenTags/node_modules/promise/lib/core.js:37:12)
at /Users/dmitry/hacks/tentags/TenTags/node_modules/promise/lib/core.js:123:15
at flush (/Users/dmitry/hacks/tentags/TenTags/node_modules/asap/raw.js:50:29)
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
See logs /var/folders/gq/zxnwqjwd75d_2rhgbzzc_0n00000gn/T/react-packager.log
at SocketClient._handleMessage (SocketClient.js:139:23)
at BunserBuf.<anonymous> (SocketClient.js:53:42)
at emitOne (events.js:77:13)
at BunserBuf.emit (events.js:169:7)
at BunserBuf.process (/Users/dmitry/hacks/tentags/TenTags/node_modules/bser/index.js:289:10)
at /Users/dmitry/hacks/tentags/TenTags/node_modules/bser/index.js:244:12
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
Command /bin/sh failed with exit code 1
What am I doing wrong? Is pusher npm only meant to work in react.js web apps? Can I not use pusher npm as is in ractnative app? I know, maybe naive questions, but I'm very new to reactnative and the whole JS, Node, npm business.
Do check you are in react's directory while installing.Have you made sure you have crypto, try installing pusher-js too... and use react-native
import Pusher from 'pusher-js/react-native';