[英]In react native @react-navigation/native-stack error occured
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.我试图在我的 vscode 终端中输入 'npm install @react-navigation/native-stack' 来安装 @react-navigation/native-stack 但在安装过程中发生错误。 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://git@github.com/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我的 package.json 文件
{
"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.我是 react-native 和编程的新手。 so I don't know what to upload here.
所以我不知道在这里上传什么。 if you need more information to solve this problem, I will upload that.
如果您需要更多信息来解决这个问题,我会上传。
It could be a compatibility issue.这可能是兼容性问题。
Try running尝试运行
npm install npm@latest -g
and check again并再次检查
I think there was a mistake in your package.json
.我认为您的
package.json
有错误。 It should be a package name following it's version.它应该是 package 名称跟在其版本之后。 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"
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.