01hanst
01hanst

Reputation: 597

react native run-ios or run-android error

i'm trying to use this project

https://github.com/FaridSafi/react-native-gifted-listview

I'll write down the order processing.

  1. download the project.zip & unzipping

  2. in terminal, i used this command [npm install]

  3. 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.

they say "use this command"

rm -rf node_modules

rm -fr $TMPDIR/react-*

watchman watch-del-all

npm install --save react-native@latest

but it couldn't solve this problem

how i can solve this problem?

Upvotes: 1

Views: 3591

Answers (1)

Tushar Khatiwada
Tushar Khatiwada

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:

  1. Get inside your react-native project: cd yourProject
  2. 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

  3. Import the installed component inside your page where you want to use: import GiftedListView from 'react-native-gifted-listview';

  4. 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

Related Questions