node-strava / node-strava-v3

API wrapper for Strava's v3 API, in Node
MIT License
356 stars 109 forks source link

Fix inability to get version from package.json #128

Closed phschaad closed 2 years ago

phschaad commented 2 years ago

require('./package') alone fails in some cases (i.e. Node versions), because that's not a valid package. Specifying the file ending fixes this issue and should be version independant. For reference and possible other ways of obtaining the version from code: https://stackoverflow.com/questions/9153571/is-there-a-way-to-get-version-from-package-json-in-nodejs-code

markstos commented 2 years ago

What's an example of a version of Node where this fails? We only support the latest LTS release and newer, currently Node 14.

phschaad commented 2 years ago

I have in fact noticed that it is not an issue with Node, but rather when using webpack to compress/bundle the code for deployment. Tested with webpack version 5.72.0.

phschaad commented 2 years ago

Thank you!

markstos commented 1 year ago

Thanks. Release today in v2.2.0.