Unable to upgrade ReactNative from version 0.59.x to the latest version, 0.64.x - react-native

I am upgrading my ReactNative project to the latest ReactNative version. My project is currently using ReactNative version, 0.59.10. I am upgrading it to the version, 0.64.2.
I run the following command in the project's root directory.
npx react-native upgrade
When I run the command, I am getting the following error.
info No version passed. Fetching latest...
info Fetching diff between v0.59.10 and v0.64.2...
info Applying diff...
warn Excluding files that exist in the template, but not in your project:
error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible
warn Continuing after failure. Some of the files are upgraded but you will need to deal with conflicts manually
info Installing "react-native#0.64.2" and its peer dependencies...
(node:37101) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'close' of undefined
at Object.<anonymous> (/Users/xandasupport/Desktop/Wais/pcl-app/node_modules/chalk/index.js:72:75)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at _chalk (/Users/xandasupport/Desktop/Wais/pcl-app/node_modules/#react-native-community/cli/build/cliEntry.js:22:39)
at handleError (/Users/xandasupport/Desktop/Wais/pcl-app/node_modules/#react-native-community/cli/build/cliEntry.js:106:46)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:37101) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:37101) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I am using Node JS version, v12.22.1. I tried using version, 14 too. I am still getting the same error. How can I fix it?

Related

Gatsby website built but 'UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined at parseError' when opening localhost

My gatsby website was running locally without problems and when I tried to restart it today without updating the code, the npm run develop build succeeds. However, when I try to open localhost in browser, this error is thrown in the terminal:
success Building development bundle - 16.014s
success Writing page-data.json files to public directory - 0.103s - 3/11
106.93/s
(node:2043) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
at parseError (/Users/sp/Documents/jamstack/training/frontend/node_modules/gatsby/src/utils/dev-ssr/render-dev-html-child.js:52:26)
at /Users/sp/Documents/jamstack/training/frontend/node_modules/gatsby/src/utils/dev-ssr/render-dev-html-child.js:106:27
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2043) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejeæction, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2043) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I can't seem to work out where this error is coming from as I did not change any of the code that was working earlier.
Does anyone have an idea?
There's no detail about the running version of Gatsby but according to this GitHub thread, while the issue is being fixed in the next release you can bypass it by installing a canary version:
npm i gatsby#webpack-split-fix

Any npm command returns error "Cannot find module yallist" even npm -v

(node:2564) UnhandledPromiseRejectionWarning: Error: Cannot find module 'yallist'
Require stack:
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\range.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\comparator.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js:4:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2564) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error
originated either by throwing inside of an async function without a catch block, or by
rejecting a promise which was not handled with .catch(). To terminate the node process
on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see
https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2564) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated.
In the future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.
I solved this by uninstalling node, and deleting the npm folder in the Roaming folder, then restarted the computer.
After that I installed node again. Everything is working now.
I occurred this problem while yarn build, what I have done the solve the problem are:
rm -rf node_modules
yarn install
yarn build
Btw, my node version is v14.18.1 and I have tried to remove yarn.lock but not worked.

How to solve make × ERR not found: make-$(SOURCE_FILES) while running npm run build command

I am trying to run command npm run build. I am getting error
`make i info Invoking build target
make i info Invoking dist/build target
(node:15892) UnhandledPromiseRejectionWarning: undefined
(Use `node --trace-warnings ...` to show where the warning was created)
(node:15892) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15892) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
make × ERR not found: make-$(SOURCE_FILES)`
Please anyone can help me to solve the problem.
I finally solved it installing make command using chocolaty in my window. I was getting error because make was not installed on my windows (I had no idea regarding that make is window's command not NodeJs').
This post helped me to solve my problem.
How to install and use "make" in Windows?

DEP0018 with express API

Im getting this error code with express API with typeorm database:
(node:23162) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
(node:23162) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23162) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I used only this basic code in my app.ts and error is still on after sudo npm run build && sudo npm run start
createConnection().then(connection => {
console.log("Try");
});
I tried also to change connection to async, but still not working.
You simply cannot connect to the database for whatever reason. It's not an issue with the ORM itself. Check your configurations, because most definitely that's where the problem resides.

How to fix "ENOENT: no such file or directory, chdir 'project-name'" when initializing a Vue Native project?

I'm trying:
vue-native init test-project
And I'm getting this output:
Using globally installed expo-cli 3.0.10
Creating Vue Native project project-new
Creating project with expo-cli
[09:09:29] --name: argument is required in non-interactive mode. √
Created project with expo-cli
(node:9072) UnhandledPromiseRejectionWarning: Error: ENOENT: no such
file or directory, chdir 'project-new'
at process.chdir (internal/process/main_thread_only.js:31:12)
at installPackages (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\src\index.js:182:11)
at createExpoProject (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\src\index.js:123:3)
at init (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\src\index.js:101:5)
at Command. (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\src\index.js:69:7)
at Command.listener (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\node_modules\commander\index.js:315:8)
at Command.emit (events.js:182:13)
at Command.parseArgs (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\node_modules\commander\index.js:651:12)
at Command.parse (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\node_modules\commander\index.js:474:21)
at Object. (C:\Users\User\AppData\Roaming\npm\node_modules\vue-native-cli\src\index.js:81:9)
(node:9072) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an async
function without a catch block, or by rejecting a promise which was
not handled with .catch(). (rejection id: 1) (node:9072) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.
I've already installed React Native CLI, Expo CLI, and Vue Native CLI. I tried to solve the issue by updating npm but it did not work.
Also when I run:
vue-native init test-project --no-crna
it is ok and no errors appear.