0

I want to remove "Warning: NetInfo has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. See https://github.com/react-native-community/react-native-netinfo" But when i run command it doesn't work.

npm install --save @react-native-community/netinfo

Preview of error when run code

Bishwa Timilsina
  • 1,053
  • 9
  • 11

2 Answers2

1

Because of the @ in the name of the package powershell treats it as a variable.

You could fix this by either using cmd.exe or putting the package name in quotes like this: npm install --save "@react-native-community/netinfo"

Rik
  • 511
  • 5
  • 16
0

Actual, @Rik's Answer is correct. i would like to add more..

  1. npm install --save "@react-native-community/netinfo" run this Command with quotations.
  2. cd android go to your android Project directory
  3. gradlew clean run this to clean your android project
  4. then run either react-native run-android or npx react-native run-android or whatever command you use to start project.
Rajitha Fernando
  • 1,655
  • 15
  • 14