Version Is Important

That’s true. Different version of libraries can make the whole thing a lot easier. It happened to me and my teammate.

We have been developing a sample application capable of presenting charts using NodeJS and ReactNative. At first, we just went our way and messing around with any libraries we found in the internet. Until one afternoon, my friend found a particular library that seemed promising. It is, though. That afternoon he tried the library and it worked just fine. He told me that we could go that way and finish our charting the next day. So I nodded and packed my bag and went home.

The morning arrived and I installed the libraries he had told me before. The name is react-native-pathjs-charts. After installing via terminal, I realized that the this thing was related to react-native-svg and not a moment later I also installed it. After that, I linked them. The instruction regarding how to set this up is available on the website.

$ npm install react-native-pathjs-charts --save
$ npm install react-native-svg --save
$ react-native link react-native-svg

After that, I got an error which wasn’t there when my friend tried the sample with it. After browsing around, I found that this issue had been found and posted on Github. It said that I needed to change some lines of code in a file because the package name had been changed. So I did. It didn’t work.

After an hour or two reading the website carefully, I realized that we might have different version of libraries. So I asked my friend which version he had used the day before. he didn’t know so he went back online and searched for possible version. After he gave me the numbers, I removed the existing libraries and re-installed them using their corresponding version.

$ npm remove react-native-pathjs-charts
$ npm remove react-native-svg

He said the version for svg was 5.1.3 and chart was 0.0.26. So I proceeded with the numbers.

$ npm install react-native-pathjs-charts@0.0.26 --save
$ npm install react-native-svg@5.1.3 --save
$ react-native link react-native-svg

I also cleared the cache, just in case. After that, I put back the sample charting code and run the project again.

$ react-native run-android

And it worked since I got the same result as my friend did the day before. After that we continued our work a bit more happier. Only a bit.


Author: anwari

stay low and keep your head down

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s