2

After upgrading past react-native 0.60.....Im being warned that I should unlink all the 3rd party libraries that were linked manually (as RN now takes care of it via auto-linking).

However when I run react-native unlink <depedency> I get the error Something went wrong while unlinking. Reason Expected [\n\r] but end of input found

Any ideas?

james murphy
  • 1,505
  • 5
  • 31
  • 57
  • My guess is one of the files parsed by the unlinking tool doesn't end with an empty newline. – Muhammed B. Aydemir Nov 29 '19 at 06:52
  • Dont think its related to the library its unlinking....same thing happens with every single library that I unlink – james murphy Nov 29 '19 at 22:57
  • I know it will sound silly but, sometimes i forget to unlink before removing a package, then i have to reinstall it, manually link it or whatnot, and after that i unlink first, check if there is some changes in files that normally would have, and remove the package; – André Pinto Dec 11 '19 at 20:52

3 Answers3

2

The Reason is, that in one of your files, the blanc-line at the end of the file is missing.

Please check following files for this empty line:

  • ios/[Project].xcodeproj/project.pbxproj
  • android/settings.gradle

You also might unlink your modules manually like this:

Open android/settings.gradle, remove the include & project Lines

After cleanup, the file should look like this:

rootProject.name = 'MyBeautifullApp'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
suther
  • 12,600
  • 4
  • 62
  • 99
0

use this command => React-native Unintsall "package-name"

savan patel
  • 254
  • 1
  • 5
0

I hope it would help you out:

If you're removing a global package however, any applications referencing it will crash.

Here are different options:

npm uninstall removes the module from node_modules, but not package.json

npm uninstall --save also removes it from dependencies in package.json

npm uninstall --save-dev also removes it from devDependencies in package.json

npm -g uninstall --save also removes it globally

Govind Soni
  • 320
  • 1
  • 2
  • 11