Reputation: 597
i'm trying to use this project
https://github.com/FaridSafi/react-native-gifted-listview
I'll write down the order processing.
download the project.zip & unzipping
in terminal, i used this command [npm install]
and this [react-native run-android] & [react-native run-ios]
but i was failed to build this project.
open-ui-iMac:react-native-gifted-listview-master openobject$ react-native run-android Android project not found. Maybe run react-native android first?
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 throw err; ^
Error: ENOENT: no such file or directory, 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)
i found a few solution of this.
rm -rf node_modules
rm -fr $TMPDIR/react-*
watchman watch-del-all
but it couldn't solve this problem
how i can solve this problem?
Upvotes: 1
Views: 3591
Reputation: 2027
You're trying to use a 3rd party React Native Component on your project. The right way to install and use the Component is as follow:
react-native
project: cd yourProject
On your terminal run the following code: npm install react-native-gifted-listview --save
. This is the way to install Components. npm install component-name --save
Import the installed component inside your page where you want to use: import GiftedListView from 'react-native-gifted-listview';
Now you can use the component:
<GiftedListView
rowView={this._renderRowView}
onFetch={this._onFetch}
firstLoader={true}
pagination={true}
refreshable={true}
withSections={false}
refreshableTintColor="blue"
/>
Upvotes: 1