0

I am trying to install rn-fetch-blob@0.10.15. but it's automatically installing the latest version i.e 0.10.16. I tried to install as follows,

npm install rn-fetch-blob@0.10.15

as per this solution, it should work as expected. But not working in my case.

Any help is appreciated.

ThinkAndCode
  • 1,319
  • 3
  • 29
  • 60
  • you can try `npm unlink ` before install a specific version of a package or remove `package-lock.json`/`yarn.lock`. – firats Aug 01 '19 at 12:48

1 Answers1

1

Directly change your package.json file:

"dependencies": {
    "rn-fetch-blob": "0.10.15",
     ...
  }

And run: npm install --save

NOTE: With npm 5 and above you don't need the --save flag and package-lock.json file gets updated every time you do npm install

ambianBeing
  • 3,449
  • 2
  • 14
  • 25
  • I had already tried it. Still, latest version is being installed. Any alternative? – ThinkAndCode Aug 02 '19 at 17:13
  • 1
    I had tried to reproduce the same thing. I installed latest version via simple `npm install` which is `rn-fetch-blob@0.10.16` and then simply changed that package.json and did `npm install`. It worked. Another thing you can try is uninstall it cleanly then do `npm cache clean --force` and then repeat my steps. – ambianBeing Aug 02 '19 at 17:31
  • After doing this how can i ensure that latest version has been installed? I mean what is the command to know currently installed version? – ThinkAndCode Aug 28 '19 at 05:11
  • @Kishore To ensure latest installation either do it manually with `npm install ` or use a manager package like `ncu npm-check-updates`. To check what packages are installed `npm list --depth=0` OR even better `npm outdated` which'll give currently installed packages and if their updated versions exists. – ambianBeing Aug 28 '19 at 07:49
  • `npm list --depth=0`is listing all the packages. is there any command to know about particular package? – ThinkAndCode Aug 28 '19 at 11:25
  • 1
    @Kishore `npm outdated` should give you a fair idea about all the packages installed with versions and update available. For specific package you could try `npm info version` which will give what`s latest available about that but it doesn't show any info on currently installed. [More](https://stackoverflow.com/questions/10972176/find-the-version-of-an-installed-npm-package) – ambianBeing Aug 31 '19 at 00:20