Theoretically, npm-scripts provides a means to run scripts during npm install . You can, for example, add these lines to your package.json :
{ "scripts" : { "preinstall" : "/usr/bin/env gem install some_gem_name" } }
Of course, you might want to add a more complex script that handles the case where Ruby and / or Rubygems are not installed, the installation of Gem does not work, etc. etc. Setting dependencies can be arbitrarily complex, so many package developers (in any language) often simply assume that the required dependencies are already running and running on the target system. Finally, the documentation for npm scripts states that
INSTALLING SCRIPTS - ANTIPATTERN
and
The only permissible use of installation or pre-installation scripts is compilation, which must be performed on the target architecture.
All in all, I suggest you instead focus your energy on adding the right installation instructions to your Readme.
Patrick oscity
source share