Can I bind npm with an instance of nodejitsu?

I am trying to use the lib that I need to install and then link to npm. I do not see a clear path to access my server this way using jitsu cli. How can i do this?

+4
source share
2 answers

I work for nodejitsu.

Firstly, I believe that your problem can be solved with bundledDependencies in your package.json, for example:

{ "bundledDependencies": [ "myModule", "myFork" ] } 

Then, when jitsu associates your deployment application (which uses npm), it will also associate your dependency with it.

If the package is in the project’s personal fork on github, npm can also be directly fetched from the git url. Check out http://npmjs.org/doc/ for more information on how to extract npm modules from non-registry sources.

Also: we have a special support group that you can contact either via support@nodejitsu.com or in #nodejitsu on irc.freenode.net.

+8
source

Have you tried using npm programmatically? The docs give an example:

 var npm = require("npm") npm.commands.install(["some", "args"], function (er, data) { if (er) return commandFailed(er) // command succeeded, and data might have some info }) 

Here you can find the full documents: https://github.com/isaacs/npm/blob/master/README.md

So, in your case, maybe you: (in psuedo code)

 npm.commands.install(['mylibarary'], function(er, data) { if (er) { throw Error(); } npm.commands.link( ... args ... function(er, data) { ... happy amazing awesome ... }); }); 

You should also go into the IRC room. People there are very helpful.

0
source

Source: https://habr.com/ru/post/1396768/


All Articles