我试图使用这个项目
https://github.com/FaridSafi/react-native-gifted-listview
我会写下订单处理。
下载project.zip&解压
在终端中,我使用了这个命令[npm install]
这个[react-native run-android]& [react-native run-ios]
但我未能建立这个项目。
open-ui-iMac:react-native-gifted-listview-master openobject $ react-native run-android 找不到Android项目。也许首先运行react-native android?
open-ui-iMac:react-native-gifted-listview-master openobject $ react-native run-ios /Users/openobject/practice/react-native-gifted-listview-master/node_modules/promise/lib/done.js:10 扔错了; ^
错误:ENOENT:没有这样的文件或目录,uv_chdir
at Error (native)
at process.chdir (/Users/openobject/practice/react-native-gifted-listview-master/node_modules/graceful-fs/polyfills.js:18:9)
at _runIOS (node_modules/react-native/local-cli/runIOS/runIOS.js:50:11)
at node_modules/react-native/local-cli/runIOS/runIOS.js:24:5
at tryCallTwo (/Users/openobject/practice/react-native-gifted-listview-master/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/openobject/practice/react-native-gifted-listview-master/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/openobject/practice/react-native-gifted-listview-master/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (node_modules/react-native/local-cli/runIOS/runIOS.js:23:10)
at Object.run (node_modules/react-native/local-cli/cliEntry.js:95:3)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)
我找到了一些解决方案。
rm -rf node_modules
rm -fr $ TMPDIR / react - *
守望者手表 - 所有
但它无法解决这个问题
我怎么能解决这个问题?
答案 0 :(得分:1)
您正在尝试在项目中使用第三方React Native Component。安装和使用Component的正确方法如下:
react-native
项目:cd yourProject
在终端上运行以下代码:npm install react-native-gifted-listview --save
。这是安装组件的方法。 npm install component-name --save
在您要使用的页面中导入已安装的组件:import GiftedListView from 'react-native-gifted-listview';
现在您可以使用组件:
<GiftedListView
rowView={this._renderRowView}
onFetch={this._onFetch}
firstLoader={true}
pagination={true}
refreshable={true}
withSections={false}
refreshableTintColor="blue"
/>