Click here to Skip to main content
16,022,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
first let me give you a little brief about my system. I am using Linux Mint alongside Windows 10 (dual boot), just saying because perhaps it might be relevant with the error I am facing.
Previously I started developing an app using expo SDK version 50, and everything was going smoothly. I did a lot of works in the app. Then for about 2-3 months, I couldn't work in the app. I was using a custom font called "Gabarito".
Now, when I wanted to work again on the project, I updated expo go to the latest version and it asked me to update expo sdk to version 51. I was facing some issues with updating expo so someone suggested me to delete `node_modules` folder and reinstall all the dependencies using `npm install`. I did so and it turned out to be fine. Then I thought of changing my font to "HindSiliguri". Now this is how my `app.js` looks like:

JavaScript
const [fontsLoaded, fontError] = useFonts({
    "HindSiliguri-Regular": require("./assets/fonts/HindSiliguri-Regular.ttf"),
    "HindSiliguri-Bold": require("./assets/fonts/HindSiliguri-Bold.ttf"),
    "HindSiliguri-Light": require("./assets/fonts/HindSiliguri-Light.ttf"),
    "HindSiliguri-Medium": require("./assets/fonts/HindSiliguri-Medium.ttf"),
    "HindSiliguri-SemiBold": require("./assets/fonts/HindSiliguri-SemiBold.ttf"),
  });

useEffect(() => {
    async function handleLayout() {
      if (fontsLoaded && initialScreen) {
        await SplashScreen.hideAsync();
      }
    }
    handleLayout();
  }, [fontsLoaded, initialScreen]);

  if (!fontsLoaded || !initialScreen) {
    return (
      <View>
        <Text>App loading, please have patience.</Text>
      </View>
    );
  }

There are some more codes that ensures that my font is completely loaded. When I open the app, the font works. Still I get the following warning:
```fontFamily "HindSiliguri-Bold" is not a system font and has not been loaded through expo-font.```
But the font is perfectly working in the app. Another error I am getting is:-
```fontFamily "anticon" is not a system font and has not been loaded through expo-font. ```

But I am not using any font called "anticon". Someone told me to install `expo-font`. so I tried to install that library (I had it installed previously but tried to reinstall) using this command `npx expo install expo-font`

And now I am getting this error:

```
› Installing 1 SDK 51.0.0 compatible native module using npm
> npm install
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /media/araf/New Volume3/Vakwita/Projects/Prose/node_modules/ajv
npm ERR! dest /media/araf/New Volume3/Vakwita/Projects/Prose/node_modules/.ajv-xJT1TTpP
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/media/araf/New Volume3/Vakwita/Projects/Prose/node_modules/ajv' -> '/media/araf/New Volume3/Vakwita/Projects/Prose/node_modules/.ajv-xJT1TTpP'

npm ERR! A complete log of this run can be found in: /home/araf/.npm/_logs/2024-06-06T12_18_04_833Z-debug-0.log
Error: npm install exited with non-zero code: 217
Error: npm install exited with non-zero code: 217
```

What I have tried:

If I try to delete the folder called `ajv` then it throws the same error with a different folder. And if I delete that too then another error comes with another different folder.


I again deleted `node_modules` and `package-lock.json` and reinstalled using `npm install`. Still facing the same issue. I tried this several times.

What I already tried to resolve this:

- delete node_modules folder
- delete package-lock.json
- run npm update
- npm cache clear --force
- npm install --save
- sudo npm install
- various combinations of the above
Posted

1 solution

If you're hitting this, you might want to try an alternative package manager. Have a look at pnp.[^]. It's a good alternative.
 
Share this answer
 
Comments
Shaidozzaman Araf 8-Jun-24 10:15am    
It seems like pnpm doesn't work with react native properly, I get some issues regarding app entry point. I tried to look up this in google and I found that pnpm doesn't work with react-native and expo due to some compatibility issues.
Pete O'Hanlon 8-Jun-24 11:26am    
If you're thinking of issues around metro and symlinks, this article show you what you need to do to resolve it https://runreactnative.dev/posts/pnpm-react-native

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900