I cloned react-native-mapbox-gl and navigated to example folder, as soon as I run npm install or yarn, I get the following error.
D:\projects\react-native-mapbox-gl-master\react-native-mapbox-gl-master\example>npm install
> [email protected] preinstall D:\projects\react-native-mapbox-gl-master\react-native-mapbox-gl-master\example
> npm run pack:gl
> [email protected] pack:gl D:\projects\react-native-mapbox-gl-master\react-native-mapbox-gl-master\example
> ./scripts/npm_pack_rngl.sh
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] pack:gl: `./scripts/npm_pack_rngl.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] pack:gl script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Shivam\AppData\Roaming\npm-cache\_logs\2018-03-14T17_37_29_438Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `npm run pack:gl`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Shivam\AppData\Roaming\npm-cache\_logs\2018-03-14T17_37_29_544Z-debug.log
Node: v8.9.4
npm: 5.6.0
It's trying to run a bash script, you'll need to use Git Bash or a shell that runs bash since you're on Windows.
I can update the scripts to be node based so you don't have to do this in the future but for now you can try that as a workaround
@nitaliano I tried to run npm install from git bash but it gives me the same error.
it's only running npm pack in the root level of the project, I'll try to update the repo with a JS PR today
Ok. thanks for your concern. Is there any workaroud I can use to run example project on windows machine?
yup you can remove this line https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/package.json#L11 and just look at the script and manually run npm pack from the root of the directory before trying to build the example project
okay the above solution worked. thanks
cool glad you got it working
@nitaliano Good thanks
Closed due inactivity.
yup you can remove this line https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/package.json#L11 and just look at the script and manually run
npm packfrom the root of the directory before trying to build the example project
that worked for me also, thank you so much
Most helpful comment
yup you can remove this line https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/package.json#L11 and just look at the script and manually run
npm packfrom the root of the directory before trying to build the example project