Example fails to compile
I tried following instructions on https://github.com/alex3165/react-mapbox-gl to run examples. On running npm run start, I get an error saying "Failed to compile", followed by a list of modules that were not found.
Failed to compile.
Error in ./src/all-shapes.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src
@ ./src/all-shapes.js 14:21-47
Error in ./src/cluster.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src
@ ./src/cluster.js 26:21-47
Error in ./src/style-update.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src
@ ./src/style-update.js 14:21-47
Error in ./src/geojson-example.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src
@ ./src/geojson-example.js 14:21-47
Error in ./src/london-cycle.js
Module not found: 'react-mapbox-gl' in /Users/georgejose/dev_files/react-mapbox-gl/example/src
@ ./src/london-cycle.js 14:21-47
I also tried re-linking by running npm run link but that did not help.
Hey I striped out everything and install node modules from scratch and I don't get any issue with running the examples, can you please try again from a clean git clone, it shouldn't happen.
I have got this issue too.I have to clone this repo and cd to example directory and install dependency with yarn install.So I got this Error when I use yarn start.
This can be fixed by installing mapbox-gl in your app, since it's a peerDep:
$ yarn add mapbox-gl