Saturday, August 30, 2025

Issue with React Native Init Command

To See All React Native Articles: Index of Lessons in Technology
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ npx react-native@latest init ReadingAppForBrightOrange
Need to install the following packages:
  react-native@0.81.1
Ok to proceed? (y) y
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'react-native@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/assets-registry@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/codegen@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/community-cli-plugin@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/gradle-plugin@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/js-polyfills@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/virtualized-lists@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-runtime@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-source-map@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/dev-middleware@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-config@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-core@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@react-native/debugger-frontend@0.81.1',
npm WARN EBADENGINE   required: { node: '>= 20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-babel-transformer@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-cache@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-cache-key@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-file-map@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-resolver@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-symbolicate@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-transform-plugins@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-transform-worker@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'ob1@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'metro-minify-terser@0.83.1',
npm WARN EBADENGINE   required: { node: '>=20.19.4' },
npm WARN EBADENGINE   current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
/home/jain/.npm/_npx/dea611a43221eddd/node_modules/react-native/cli.js:147
- Switch to ${styleText(['grey', 'bold'], 'npx @react-native-community/cli init')} for the identical behavior.
              ^

TypeError: styleText is not a function
    at warnWithDeprecated (/home/jain/.npm/_npx/dea611a43221eddd/node_modules/react-native/cli.js:147:15)
    at main (/home/jain/.npm/_npx/dea611a43221eddd/node_modules/react-native/cli.js:219:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.19.1

FIX

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16555  100 16555    0     0   105k      0 --:--:-- --:--:-- --:--:--  105k
=> Downloading nvm from git to '/home/jain/.nvm'
=> Cloning into '/home/jain/.nvm'...
remote: Enumerating objects: 383, done.
remote: Counting objects: 100% (383/383), done.
remote: Compressing objects: 100% (326/326), done.
remote: Total 383 (delta 43), reused 179 (delta 29), pack-reused 0 (from 0)
Receiving objects: 100% (383/383), 392.12 KiB | 2.10 MiB/s, done.
Resolving deltas: 100% (43/43), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/jain/.bashrc
=> Appending bash_completion source string to /home/jain/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ nvm install 20
Downloading and installing node v20.19.4...
Downloading https://nodejs.org/dist/v20.19.4/node-v20.19.4-linux-x64.tar.xz...
################################################################################################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v20.19.4 (npm v10.8.2)
Creating default alias: default -> 20 (-> v20.19.4)
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ nvm use 20
Now using node v20.19.4 (npm v10.8.2)
(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ node -v
v20.19.4

No comments:

Post a Comment