我的 npm install 有错误,有人可以解释一下吗?

I have an error with npm install, can someone explain it?

当我尝试 npm install react-color 时,它显示了这个错误:

npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "@types/" of package "@types/@react-navigation/native": name can only contain URL-friendly characters. 

npm install react-dom 或其他 npm install 也发生了同样的情况。谁能解释一下为什么会这样?

这是我的依赖项:

"dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/native-stack": "^6.6.2",
    "@react-navigation/stack": "^6.2.1",
    "axios": "^0.27.2",
    "expo": "~45.0.0",
    "expo-av": "~11.2.3",
    "expo-cli": "^5.4.3",
    "expo-constants": "^13.1.1",
    "expo-linear-gradient": "~11.3.0",
    "expo-linking": "^3.1.0",
    "expo-status-bar": "~1.3.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.1",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "^4.2.5",
    "react-native-screens": "^3.13.1",
    "react-native-video": "^5.2.0",
    "react-native-web": "0.17.7",
    "react-native-web-webview": "^1.0.2",
    "react-color": "2.19.3",
    "react-native-webview": "^11.18.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react-navigation/native": "^6.0.10",
    "@types/react": "~17.0.21",
    "@types/react-native": "^0.66.18",
    "typescript": "~4.3.5"
  },

您需要删除 url 中 react-navigation 部分的 @ 前面。 查看 npm 网站了解更多信息:https://www.npmjs.com/package/@types/react-navigation

该错误基本上是说您添加的包名称不正确,因为该路径包含 URL 中不允许的字符。