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?

3
  • My guess is one of the files parsed by the unlinking tool doesn't end with an empty newline. Commented Nov 29, 2019 at 6:52
  • Dont think its related to the library its unlinking....same thing happens with every single library that I unlink Commented Nov 29, 2019 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; Commented Dec 11, 2019 at 20:52

3 Answers 3

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'
Sign up to request clarification or add additional context in comments.

1 Comment

where we can get this file ios/[Project].xcodeproj/project.pbxproj
0

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

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.