After creating a React Native project with Expo using expo init MapTry
, I encountered an issue while trying to install the MapBox library. Despite following the installation guide at https://github.com/rnmapbox/maps#Installation, I faced an error message when attempting to run
npm install rnmapbox/maps#main --save
in the terminal. The error displayed is as follows:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Upon further investigation, I came across another potential solution on the official NPM site: https://www.npmjs.com/package/@rnmapbox/maps. However, even after running npm i @rnmapbox/maps
as instructed, I continued to receive the same error message mentioned earlier. What steps should I take next? How can I successfully integrate the MapBox library into my React Native project?