npm / ndm

ndm allows you to deploy OS-specific service-wrappers directly from npm-packages.
ISC License
182 stars 22 forks source link

Using self-install with private npme modules #98

Open jcferrer opened 9 years ago

jcferrer commented 9 years ago

Following is a workaround to make it possible for npme private modules to be self-installed.

Assuming private module is @private/myapp

  1. On the "bin" script, Include the private repo prefix, after the require statement:

var argv = require('yargs').argv , ndm = require('ndm')('@private/myapp');

The docs say that you should use the name of the module inside the service.json, but without the prefix, the service.json is not found.

  1. On the service.json, the "module" property has to be included for the service instantiation path to be set correctly.

"myapp": { "description": "myapp", "module": "@private/myapp", "scripts": { "start": "node ./lib/myapp.js" }, ........

Without the "module" property the script change-directory (cd) command changes to an incorrect path.