Я создаю NPM пакет. Как установить peerDependency, когда пользователь устанавливает мой пакет NPM? - PullRequest
0 голосов
/ 01 февраля 2020

У меня проблема с реагировать-родной-вектор-значки . Я установил его как dependency и peerDependency, но когда я устанавливаю пакет NPM в проект, я получаю сообщение об ошибке. Насколько я понимаю, peerDependency - это зависимость, используемая для пакетов npm, поэтому установлены пакеты моей библиотеки NPM. Это правильно?

В моей библиотеке NPM я вручную связал act-native-vector-icons в моем подфайле и info.plist:

Подфайл

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

info.plist

<key>UIAppFonts</key>
<array>
  <string>AntDesign.ttf</string>
  <string>Entypo.ttf</string>
  <string>EvilIcons.ttf</string>
  <string>Feather.ttf</string>
  <string>FontAwesome.ttf</string>
  <string>FontAwesome5_Brands.ttf</string>
  <string>FontAwesome5_Regular.ttf</string>
  <string>FontAwesome5_Solid.ttf</string>
  <string>Foundation.ttf</string>
  <string>Ionicons.ttf</string>
  <string>MaterialIcons.ttf</string>
  <string>MaterialCommunityIcons.ttf</string>
  <string>SimpleLineIcons.ttf</string>
  <string>Octicons.ttf</string>
  <string>Zocial.ttf</string>
</array>

пакет. json

 "dependencies": {
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-modal": "^11.5.3",
    "react-native-vector-icons": "^6.6.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "@types/jest": "^24.0.24",
    "@types/react-native": "^0.60.25",
    "@types/react-native-vector-icons": "^6.4.5",
    "@types/react-test-renderer": "16.9.1",
    "@typescript-eslint/eslint-plugin": "^2.12.0",
    "@typescript-eslint/parser": "^2.12.0",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-test-renderer": "16.9.0",
    "typescript": "^3.7.3"
  },
  "peerDependencies": {
    "react": "*",
    "react-native": "*",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-modal": "^11.5.3",
    "react-native-vector-icons": "^6.6.0"
  },
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...