Home > Mobile >  In react native @react-navigation/native-stack error occured
In react native @react-navigation/native-stack error occured

Time:09-19

I was trying to input 'npm install @react-navigation/native-stack' In my vscode's terminal to install @react-navigation/native-stack but during installing, error occured. The following is error message.

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/react-navigation/native-stack.git
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR! path(my log files path)

my package.json file

{
  "name": "userinterface",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@react-navigation/native": "^6.0.13",
    "expo": "~46.0.9",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-native": "0.69.5",
    "react-native-screens": "~3.15.0",
    "react-native-safe-area-context": "4.3.1",
    "undefined": "react-navigation/native-stack"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

I'm newbie for react-native and programming. so I don't know what to upload here. if you need more information to solve this problem, I will upload that.

CodePudding user response:

It could be a compatibility issue.

Try running
npm install npm@latest -g
and check again

CodePudding user response:

I think there was a mistake in your package.json. It should be a package name following it's version. In this case it's should be

"dependencies": {
    "@react-navigation/native": "^6.0.13",
    "expo": "~46.0.9",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-native": "0.69.5",
    "react-native-screens": "~3.15.0",
    "react-native-safe-area-context": "4.3.1",
    "react-navigation/native-stack": "^6.9.0"
  },
  • Related