stackvana / hook.io

Open-Source Microservice Hosting Platform
https://hook.io
Other
1.26k stars 117 forks source link

Module install fails when requiring from module relative paths #115

Open joshgillies opened 8 years ago

joshgillies commented 8 years ago

Uncovered this issue when trying to use: https://github.com/devongovett/jpg-stream.

Their API suggests requiring their JPEG encoder / decoder via a module relative path. Eg: require('jpg-stream/decoder').

In cases like this, hook.io tries to install jpg-stream/decoder which isn't a valid package in the npm registry.

A workaround is to first require('jpg-stream'), run the hook, then require the decoder via require('jpg-stream/decoder').

Marak commented 8 years ago

Good catch!

Shouldn't be too hard to fix. Just need to check for / and remove anything after it from the module check.