heremaps / maps-api-for-javascript-examples

Self-contained examples for Maps API for JavaScript v3.
https://developer.here.com/javascript-apis/documentation/v3/maps
Other
202 stars 431 forks source link

cannot install simple-element-resize-detector #121

Closed I-keep-trying closed 2 years ago

I-keep-trying commented 2 years ago

Following the instructions here: https://developer.here.com/documentation/maps/3.1.26.0/dev_guide/topics/react-practices.html

I have succeeded in installing the maps api for javascript, and rendered a basic map, however, I cannot proceed to install the resize package. The error in my console is as follows:

PS C:\Users\webdev\countries3> npm install simple-element-resize-detector --save
npm ERR! code E404
npm ERR! 404 Not Found - GET https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/simple-element-resize-detector - not_found
npm ERR! 404 
npm ERR! 404  'simple-element-resize-detector@*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\AppData\Local\npm-cache\_logs\2022-01-04T17_03_21_962Z-debug.log

My npm config file contains the following:

@here:registry https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/=true
registry=https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/

How do I install the resize detector package? Something seems to be missing from the instructions. I don't see that package at all in the artifactory repo either.

oleksmarkh commented 2 years ago

Your NPM is indeed configured to look up for all packages in HERE registry. You can try changing it to only include

@here:registry = "https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/"
I-keep-trying commented 2 years ago

Hey thanks for the quick response.

Everything works now, and I now have a working example using React Hooks. Please feel free to review and let me know if it's useful.

Hooks repo