Metro: Could not list contents of .... Couldn't follow symbolic link.

Created on 10 Oct 2018  路  23Comments  路  Source: facebook/metro

Getting this error in android with doing release build.

cd android && ./gradlew assembleDevRelease

FAILURE: Build failed with an exception.

* What went wrong:
Could not list contents of '/.../node_modules/metro/node_modules/.bin/babylon'. Couldn't follow symbolic link.

Most helpful comment

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

All 23 comments

Tried everything mentioned here but still getting this error

image

rm -rf node_modules && npm install

Any solution for this??. I have also the same problem.

@AnchalMulchandani you can open project in android studio and update buildsdk and target sdk to solve this

1.We just need to delete the particular files(which is mentioned in the error) present inside ".bin" folder(nodemodule/node-pre-gyp/nodemodule/.bin/)

  1. Clean and rebuild the app
  2. Generate Signed apk

if we have run the bundle command before,then we will get the error of image duplicity-
for that

  1. we need to remove all the photos from android drawable folders
  1. Clean and rebuild the app
  2. Generate Signed apk

Same issue here with RN 0.59.5:

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Could not list contents of '/Users/jdnichollsc/builds/y9nRxChC/0/myapp/node_modules/.bin/needle'. Couldn't follow symbolic link.

@jdnichollsc You just need to delete the file present inside .bin folder.
just go to the respective path where the error file located and delete that.

and also make sure after deleting the file you have already deleted all the images from drawable folder , RN0.59 not support that and android automatically build the images for device in signed apk.

Thanks!

@AnchalMulchandani did not work the above solution. Please give me some solution to build signed apk.

@AnchalMulchandani did not work the above solution. Please give me some solution to build signed apk.

what issue you are facing?

rm -rf node_modules && npm install

worked!

Just run:
rm -rf node_modules/metro/node_modules/.bin/babylon

for any other similar issues remove that file only
eg:
rm-rf /Users/kumarutsav111/Documents/OrtholiveProviderAppVijay/node_modules/.bin/uuid

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

@dvuvne Buddy, you make my day. Thanks :)

@dvuvne I've run it just in /node_modules/ folder and it is helped 馃憤

@dvuvne work for me, Thanks

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

@dvuvne This worked. Thank you.

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

It worked for me.. thanks.. can you please tell me what exactly this command does? @dvuvne

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

thanks so much....worked for me.... but what is this command any way ? 馃

If rm -rf node_modules && npm install does not do the trick, run the following in your project dir: find . -type l -exec test ! -e {} \; -delete

This worked for me. Thank you so much!

find . -type l find all files of type link
-exec execute the following command:
test ! -e {} test if file found does not exist
\; termination symbol for -exec
-delete delete the broken link

You can try to get through android studio first

Was this page helpful?
0 / 5 - 0 ratings