npx exp start is encounter unknown error when running - react-native
I am relatively new to React Native development so I am using Expo to launch my developing app to test it out. However, it seems that the command to start the app is encountering an unknown error.
The command I used:
npx expo start --tunnel
npx expo start
The packages that I have in the project:
+-- #babel/core#7.20.12
+-- #egjs/hammerjs#2.0.17 extraneous
+-- #react-navigation/core#6.4.6 extraneous
+-- #react-navigation/elements#1.3.15 extraneous
+-- #react-navigation/native#6.1.4 extraneous
+-- #react-navigation/routers#6.1.6 extraneous
+-- #react-navigation/stack#6.3.14 extraneous
+-- #types/hammerjs#2.0.41 extraneous
+-- color-string#1.9.1 extraneous
+-- color#4.2.3 extraneous
+-- expo-status-bar#1.4.2
+-- expo#47.0.13
+-- fast-deep-equal#3.1.3 extraneous
+-- filter-obj#1.1.0 extraneous
+-- UNMET DEPENDENCY firebase#9.7.0
+-- hoist-non-react-statics#3.3.2 extraneous
+-- nanoid#3.3.4 extraneous
+-- prop-types#15.8.1 extraneous
+-- query-string#7.1.3 extraneous
+-- react-freeze#1.0.3 extraneous
+-- react-native-gesture-handler#2.9.0 extraneous
+-- react-native-safe-area-context#4.4.1 extraneous
+-- react-native-screens#3.18.2 extraneous
+-- react-native#0.70.5
+-- react#18.1.0
+-- simple-swizzle#0.2.2 extraneous
+-- split-on-first#1.1.0 extraneous
+-- strict-uri-encode#2.0.0 extraneous
+-- use-latest-callback#0.1.5 extraneous
`-- warn-once#0.1.1 extraneous
The packages I have globally:
+-- #expo/ngrok#
+-- expo-cli#6.3.1
`-- npm#9.5.0
This is the result I received:
*QR code generated*
Logs for your project will appear below. Press Ctrl+C to exit.
› Detected a change in babel.config.js. Restart the server to see the new results. You may need to clear the bundler cache with the --clear flag for your changes to take effect.
node:events:491
throw er; // Unhandled 'error' event
^
Error: UNKNOWN: unknown error, lstat 'C:\Users\loral\OneDrive\subjects\year 2\SEG\Bytes\Bytes\BytesApp\node_modules\.react-native-MGkSht9O\React\Base'
Emitted 'error' event on NodeWatcher instance at:
at NodeWatcher.checkedEmitError (C:\Users\loral\OneDrive\subjects\year 2\SEG\Bytes\Bytes\BytesApp\node_modules\metro-file-map\src\watchers\NodeWatcher.js:144:12)
at Walker.emit (node:events:513:28)
at C:\Users\loral\OneDrive\subjects\year 2\SEG\Bytes\Bytes\BytesApp\node_modules\walker\lib\walker.js:52:12
at FSReqCallback.oncomplete (node:fs:207:21) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'lstat',
path: "C:\\Users\\loral\\OneDriven\\subjects\\year 2\\SEG\\Bytes\\Bytes\\BytesApp\\node_modules\\.react-native-MGkSht9O\\React\\Base"
}
Can someone please tell me what is causing this problem?
It was working fine for a while, however, it started to give me this error.
I tried
npm install
npm audit fix --force
npx expo install
but none of these command seems to work.
I have reinstalled expo-cli and reinstall Nodejs as well.
Related
what is the difference between `-- <package-name#version> and +-- <package-name#version>?
When I run the command: npm list -g --depth=0 The following output is obtained: output in cmd admin mode here 2 packages are listed with +-- while another is listed as `-- what is it telling me about that package? Here 2 packages are listed with +-- while another is listed as `-- what is it telling me about that package?
I think the +-- indicates that the package is a top-level dependency. When there is no +, just --, it is a sub-dependency of another package.
how to resolve cve CVE-2020-28052 json-schema for npm
By performing a dependency check using owasp 7.0.4 on my project, which uses java for BE and JS for BFE, i got ceveral CVEs noted over 8. One is the json-schema package used by npm. This the packages configuration in the package.json: dependency: "json-schema": "^0.4.0" "npm": "^7.13.0" when calling the command npm ls json-schema to check json-schema use i got: +-- json-schema#0.4.0 +-- lerna#4.0.0 | `-- #lerna/add#4.0.0 | `-- pacote#11.3.5 | `-- #npmcli/run-script#1.8.6 | `-- node-gyp#7.1.2 | `-- request#2.88.2 | `-- http-signature#1.2.0 | `-- jsprim#1.4.2 | `-- json-schema#0.4.0 deduped `-- npm#7.24.2 `-- node-gyp#7.1.2 `-- request#2.88.2 `-- http-signature#1.2.0 `-- jsprim#1.4.1 `-- json-schema#0.2.3 I see that i need to somehow force npm use the latest json-schema version. Can please anyone give me a hint, if this is the right way and how to achieve it?
Problem solved by updating npm to 8.6.0
How to resolve the transitive dependencies of different versions in npm?
My application depends on npm packages ajv-keywords & #apideck/better-ajv-errors which in turn are dependent on package ajv but of different versions as shown in below errors. npm ERR! peer dep missing: ajv#^6.9.1, required by ajv-keywords#3.5.2 npm ERR! peer dep missing: ajv#>=8, required by #apideck/better-ajv-errors#0.2.5 Solutions I tried with no effect - Installed and executed npm-install-peers Solution mentioned in https://stackoverflow.com/a/56495651/16958085 Below graph shows how the two packages are loaded - > npm ls #apideck/better-ajv-errors#0.2.5 `-- my-app#0.1.8 `-- react-scripts#5.0.0-next.37 `-- workbox-webpack-plugin#6.2.4 `-- workbox-build#6.2.4 `-- #apideck/better-ajv-errors#0.2.5 > npm ls ajv-keywords#3.5.2 +-- babel-loader#8.2.2 | `-- schema-utils#2.7.1 | `-- ajv-keywords#3.5.2 +-- my-app#0.1.8 | `-- react-scripts#5.0.0-next.37 | `-- react-dev-utils#12.0.0-next.37 | `-- fork-ts-checker-webpack-plugin#6.0.5 | `-- schema-utils#2.7.0 | `-- ajv-keywords#3.5.2 deduped `-- webpack#5.53.0 `-- schema-utils#3.1.1 `-- ajv-keywords#3.5.2 deduped Please suggest an appropriate solution to satisfy both the dependencies.
that's never a fun situation to be in, and can't say either npm nor yarn have ever managed solved this completely/cleanly. Normally, you'd be stuck waiting for your dependencies to unpin, or upgrade their versions... That said, not sure if you have a specific requirement to use an older version of ajv-keywords, but the latest ajv-keywords uses ajv v8. updating your package.json with "ajv-keywords": "^5.0.0" and re-running npm install should get you there. If in doubt, be sure to review their readme to verify the update doesn't imply any unexpected changes for you.
What is the React Native version compatible with android api16?
I install react native and created a sample project. but it cannot be run on android version prior to android 6. so i created project with earlier version. following errors occurred. please help. This is my installation section. C:\react>npm i -g rninit C:\Users\User\AppData\Roaming\npm\rninit -> C:\Users\User\AppData\Roaming\npm de_modules\rninit\index.js C:\Users\User\AppData\Roaming\npm `-- rninit#0.1.1 +-- chalk#1.1.3 | +-- ansi-styles#2.2.1 | +-- escape-string-regexp#1.0.5 | +-- has-ansi#2.0.0 | | `-- ansi-regex#2.1.1 | +-- strip-ansi#3.0.1 | `-- supports-color#2.0.0 +-- prompt#0.2.14 | +-- pkginfo#0.4.0 | +-- read#1.0.7 | | `-- mute-stream#0.0.7 | +-- revalidator#0.1.8 | +-- utile#0.2.1 | | +-- async#0.2.10 | | +-- deep-equal#1.0.1 | | +-- i#0.3.5 | | +-- mkdirp#0.5.1 | | | `-- minimist#0.0.8 | | +-- ncp#0.4.2 | | `-- rimraf#2.6.1 | | `-- glob#7.1.2 | | +-- fs.realpath#1.0.0 | | +-- inflight#1.0.6 | | | `-- wrappy#1.0.2 | | +-- inherits#2.0.3 | | +-- minimatch#3.0.4 | | | `-- brace-expansion#1.1.7 | | | +-- balanced-match#0.4.2 | | | `-- concat-map#0.0.1 | | +-- once#1.4.0 | | `-- path-is-absolute#1.0.1 | `-- winston#0.8.3 | +-- colors#0.6.2 | +-- cycle#1.0.3 | +-- eyes#0.1.8 | +-- isstream#0.1.2 | +-- pkginfo#0.3.1 | `-- stack-trace#0.0.10 `-- semver#5.3.0 This is project initialization C:\react>rninit init TestProject --source react-native#0.1.1 This will walk you through creating a new React Native project in C:\react\TestP roject Installing react-native package from npm... npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\R oaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "react-nativ e#0.1.1" npm ERR! node v6.10.3 npm ERR! npm v4.1.1 npm ERR! code ETARGET npm ERR! notarget No compatible version found: react-native#0.1.1 npm ERR! notarget Valid install targets: npm ERR! notarget 0.0.0, 0.0.5, 0.0.6, 0.1.0, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.3.9, 0.3.10, 0.3.11, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0-rc1, 0.5.0, 0.6.0-rc, 0.6.0, 0.7.0-rc, 0.7.0-rc.2, 0. 7.1, 0.8.0-rc, 0.8.0-rc.2, 0.8.0, 0.9.0-rc, 0.9.0, 0.10.0-rc, 0.10.0, 0.11.0-rc, 0.10.1, 0.11.0, 0.11.1, 0.11.2, 0.12.0-rc, 0.11.3, 0.11.4, 0.12.0, 0.13.0-rc, 0 .13.0, 0.13.1, 0.13.2, 0.14.0-rc, 0.14.0, 0.14.1, 0.15.0-rc, 0.14.2, 0.15.0, 0.1 6.0-rc, 0.16.0, 0.17.0-rc, 0.17.0, 0.18.0-rc, 0.18.0, 0.18.1, 0.19.0-rc, 0.19.0, 0.20.0-rc1, 0.20.0, 0.21.0-rc, 0.21.0, 0.22.0-rc, 0.22.0-rc3, 0.22.0-rc4, 0.22. 0-rc5, 0.22.0, 0.22.1, 0.22.2, 0.23.0-rc1, 0.23.0-rc3, 0.23.0-rc4, 0.24.0-rc, 0. 24.0-rc1, 0.23.0, 0.24.0-rc2, 0.24.0-rc3, 0.23.1, 0.24.0-rc4, 0.24.0-rc5, 0.25.0 -rc, 0.24.0, 0.24.1, 0.26.0-rc, 0.25.1, 0.26.0, 0.27.0-rc, 0.26.1, 0.26.2, 0.27. 0-rc1, 0.27.0-rc2, 0.26.3, 0.27.0-rc3, 0.27.0, 0.28.0-rc.0, 0.27.1, 0.27.2, 0.28 .0, 0.29.0-rc.0, 0.29.0-rc.1, 0.29.0-rc.2, 0.29.0-rc.3, 0.30.0-rc.0, 0.29.0, 0.2 9.1, 0.29.2, 0.30.0, 0.31.0-rc.0, 0.31.0-rc.1, 0.31.0, 0.32.0-rc.0, 0.33.0-rc.0, 0.32.0, 0.33.0-rc.1, 0.32.1, 0.33.0, 0.34.0-rc.0, 0.33.1, 0.34.0, 0.35.0-rc.0, 0.34.1, 0.36.0-rc.0, 0.35.0, 0.36.0-rc.1, 0.36.0, 0.37.0-rc.0, 0.36.1, 0.37.0-rc .2, 0.37.0-rc.3, 0.37.0-rc.4, 0.37.0, 0.38.0-rc.0, 0.38.0-rc.1, 0.39.0-rc.0, 0.3 8.0, 0.39.0, 0.40.0-rc.0, 0.38.1, 0.40.0-rc.1, 0.39.1, 0.40.0-rc.2, 0.39.2, 0.40 .0, 0.41.0-rc.0, 0.41.0-rc.1, 0.42.0-rc.0, 0.41.0, 0.42.0-rc.1, 0.41.1, 0.41.2, 0.42.0-rc.2, 0.42.0-rc.3, 0.42.0, 0.43.0-rc.0, 0.43.0-rc.1, 0.43.0-rc.2, 0.42.2, 0.43.0-rc.3, 0.42.3, 0.43.0-rc.4, 0.44.0-rc.0, 0.43.0, 0.43.1, 0.43.2, 0.43.3, 0.43.4, 0.44.0, 0.45.0-rc.0, 0.45.0-rc.1, 0.44.1, 0.44.2, 0.45.0-rc.2 npm ERR! notarget npm ERR! notarget This is most likely not a problem with npm itself. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! Please include the following file with any support request: npm ERR! C:\react\TestProject\npm-debug.log `npm install --save react-native#0.1.1` failed what are the versions that are compatible for each android API s.Thank You
Minimum SDK for Android is 4.1 (API 16) and for iOS >= iOS 7.0. Here is the official document link Update: As of 9th Aug 2021, it is Android 5.0 - API 21 and iOS 11.0 Source
Mismatch npm? Why does 'yo generator-jhipster' not show oracle in my database options?
The latest version of jHipster gives different options than the one being displayed in my command prompt. I am wondering why am I missing some things like the oracle database option? Does anyone have any ideas? Doing npm list generator-jhipster shows that I in fact DO have the current latest version. This is what I should see: What I should see Versus what I actually see: https://twitter.com/BuilderDeviser/status/694251531261050882 Doing an npm list -g --depth=0 : C:\Program Files\nodejs +-- bower#1.7.7 +-- capslink#0.0.0 +-- generator-jhipster#2.27.0 +-- grunt-cli#0.1.13 +-- gulp#3.9.0 +-- npm#3.6.0 +-- reinstall#1.1.0 +-- semver#5.1.0 +-- strongloop#6.0.0 `-- yo#1.6.0
Found the problem.... i did a drive search for 'generator-jhipster' and windows found all folders of that name. I looked at each path and found that generator-jhipster way back from 2.7 was still hanging around in zip format. I definitely don't need that anymore. I ended up trashing any old instances of generator-jhipster and any cache/temp locations. I reinstalled forcing npm to target 2.27 by doing 'npm install -g generator-jhipster#2.27' Now I have the current and latest version of jhipster runnning!