Drew Gallagher
Drew Gallagher

Reputation: 917

React-native link is not working properly

I tried installing and linking react-native sound into my project. However, when I run the following command in my project directory,

react-native link react-native-sound

the library doesn't link and I get the following result:

Scanning 758 folders for symlinks in /Users/MY_USER_NAME/PROJECT_NAME/node_modules 

I think my node or npm setup is wrong.

Upvotes: 8

Views: 37215

Answers (4)

fn_o1
fn_o1

Reputation: 71

With latest version of react-native-cli, you can just do:

npx react-native-asset

Upvotes: 4

Mohammad Akbari
Mohammad Akbari

Reputation: 109

1- create new file in project root and name it react-native.config.js

2- add this code to react-native.config.js :

    module.exports = {
    project: {
      ios: {},
      android: {},
    },
    assets: ['./src/assets/fonts/'],
  };

3- change ['./src/assets/fonts/'] to your fonts path

4- now run react-native link

thats it

Upvotes: 8

coderzzz18
coderzzz18

Reputation: 2625

I had the same issue in linking a npm package, I closed the react native android project in android studio (where I was linking the npm repo), It worked fine for me.

Upvotes: 0

HazA
HazA

Reputation: 1384

Ok after some digging, I found the issue. https://github.com/facebook/react-native/pull/14863

Maybe try applying that fix locally, it should work then.

Upvotes: 5

Related Questions