ubilabs / google-maps-react-hooks

The JavaScript library to easily implement a Google Maps map into your react application. It comes with a collection of React hooks to access the map instance or different Maps JavaScript Services.
MIT License
77 stars 13 forks source link

Can not install the package #102

Open toppyc4 opened 1 year ago

toppyc4 commented 1 year ago

I try to install the package with npm to my next.js app that have react 18 and got :

npm ERR! code 1
npm ERR! path D:\Code\Google-map-Hackathon\test-next-app\node_modules\@ubilabs\google-maps-react-hooks
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\toppy\AppData\Local\Temp\postinstall-e682e399.cmd
npm ERR! npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

with bunch of other errors I try to install other package (react-hot-toast) and It work fine

toppyc4 commented 1 year ago

Also I can not view your example locally when I run npm run: start: places-autocomplete-example I got:

> start:places-autocomplete-example
> EXAMPLE=places-autocomplete run-p start:library start:example

'EXAMPLE' is not recognized as an internal or external command,
operable program or batch file.
nora-soderlund commented 1 year ago

This seems to originate from the 1.6.0 release and upwards (1.6.2 right now).

1.5.3 still works: npm install @ubilabs/google-maps-react-hooks@1.5.3

yfr commented 1 year ago

This is a problem with environment variables and setting them. Currently, how the env is set, only works for *nix systems and not for windows. That's what the error message say, I think.

https://www.npmjs.com/package/cross-env seems to handle these cases. It's in maintenance mode, but seems to still do what needs to be done.

@BiniCodes May you have a look?