首页 > 解决方案 > 安装 react-native-vcard 包时出错

问题描述

我正在尝试为我的 react-native 应用程序安装“React Native vCards”插件。但是当我跑步时

npm install react-native-vcards@https://github.com/idxbroker/react-native-vcards.git --save

我收到以下错误

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t 
https://github.com/idxbroker/react-native-vcards.git
npm ERR!
npm ERR! remote: Invalid username or password.
npm ERR! fatal: Authentication failed for 
'https://github.com/idxbroker/react-native-vcards.git/'
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dijish/.npm/_logs/2018-09-02T10_18_24_987Z- 
debug.log

标签: androidreact-nativenpm-installvcf-vcard

解决方案


而不是这个命令

npm install react-native-vcards@https://github.com/idxbroker/react-native-vcards.git --save

添加"vcards-js": "git+https://git@github.com/idxbroker/vCards-js#react-native"到 package.json 依赖项

并运行npm install

并将此插件用作import vCard from 'vcards-js';


推荐阅读