折腾:
期间,
需要去安装最新版本的:
想要在之前的:
npm install react-native-vector-icons –save
指定对应的版本。
npm github 如何安装
npm github 如何安装最新版
nodejs-wiki-book/node_npm.rst at master · nodejs-tw/nodejs-wiki-book · GitHub
npm github 指定版本
npm install 指定版本
npm常用命令 – 腾讯Web前端 IMWeb 团队社区 | blog | 团队博客
用npm install react-native-vector-icons@master –save但是出错:
➜ node_modules npm install react-native-vector-icons@master –save npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "react-native-vector-icons@master" "–save" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code ETARGET npm ERR! notarget No compatible version found: react-native-vector-icons@’master’ npm ERR! notarget Valid install targets: npm ERR! notarget ["4.0.0","3.0.0","2.1.0","2.0.3","2.0.2","2.0.1","2.0.0","1.3.4","1.3.3","1.3.2","1.2.1","1.2.0","1.1.1","1.1.0","1.0.4","1.0.3","1.0.2","1.0.1","1.0.0","1.0.0-rc","0.8.5","0.8.4","0.8.3","0.8.2","0.8.1","0.8.0","0.7.2","0.7.1","0.7.0","0.6.11","0.6.10","0.6.9","0.6.8","0.6.7","0.6.6","0.6.5","0.6.4","0.6.3","0.6.2","0.6.1","0.6.0","0.5.0","0.4.0","0.3.3","0.3.2","0.3.1","0.3.0","0.2.0","0.1.0"] npm ERR! notarget npm ERR! notarget This is most likely not a problem with npm itself. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn’t exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of ‘navbar-native’ npm ERR! notarget npm ERR! Please include the following file with any support request: npm ERR! /Users/crifan/dev/dev_root/daryun/KeYouTong/2.0/sourcecode/react_native/AwesomeProject/node_modules/navbar-native/node_modules/npm-debug.log ➜ node_modules |
然后去官网注意到:
GitHub – oblador/react-native-vector-icons at v4.0.0
4.0.0中,已经好像包含最新的4.7的FontAwesome了?
➜ node_modules npm install [email protected] –save [email protected] react-native-vector-icons |
【总结】
最后用:
npm install [email protected] —save |
即可实现,安装指定的4.0.0版本的react-native-vector-icons。