skip to Main Content

I’m trying to use Ionicons in react native with vscode. But when I type the command:

npm install react-native-vector-icons/Ionicons

I receive the error:

PS C:ReactNProjectstest230215> npm install react-native-vector-icons/Ionicons
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/react-native-vector-icons/Ionicons.git
npm ERR! [email protected]: Permission denied (publickey).
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.

I tried removing the nod_modules folder and tried to install again but still nog success. Does anyone have a clue?

2

Answers


  1. Are you sure of your npm command?

    I found this command: npm install –save react-native-vector-icons

    (source: https://github.com/oblador/react-native-vector-icons#installation)

    And then you import react-native-vector-icons/Ionicons at the top of your js/ts file(s)

    Login or Signup to reply.
  2. You need to install react-native-vector-icons instead of react-native-vector-icons/Ionicons as docs. After following instructions you can simply use it by importing.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search