0

As per this SO Solution I tired to install the specific version of react-native-calendars like follows,

npm install react-native-calendars@1.212.0

Once the installation is done I am able to see it in package.json like this

"react-native-calendars": "^1.212.0"

This indicates required venison is installed.

When I ran npm view react-native-calendars version result is 1.1252.0 -- which is latest version of react-native-calendars.

when I ran npm list react-native-calendars result is -- react-native-reanimated@1.13.2

  1. what is npm command to be used to check for installed npm package version?
ThinkAndCode
  • 1,319
  • 3
  • 29
  • 60

2 Answers2

0

npm view shows the package on the remote NPM repository.

npm list shows the package version installed.

package.json shows the package version range to be used.

The -- ... in npm list is showing it's dependencies in a tree. To see just the package, use npm list package --depth=0.

0xLogN
  • 3,289
  • 1
  • 14
  • 35
  • So, both `npm view version` and `npm view versions` gives both remote versions, right! Then what would be the difference between these two commands? – ThinkAndCode Feb 24 '21 at 05:30
0

I can see you are using npm list, which is the correct command to check node modules version. But the strange thing is that its returning a different version other than mentioned in package json. So I think you need to do 3 things.

1: Uninstall the package completely.
2: Clean gradlew cache and install the module again mentioning specific version number and check again.
3: Start npm with --reset-cache.
Debakant Mohanty
  • 805
  • 1
  • 10
  • 19