4

I'm trying to use a lib that I need to install and then link with npm. I don't see any clear path for me to access my server this way using the jitsu cli. How would I go about doing this?

fancy
  • 48,619
  • 62
  • 153
  • 231

2 Answers2

8

I work for nodejitsu.

First, I believe your problem can be solved by using bundledDependencies in your package.json like so:

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

Then, when jitsu bundles your app for deployment (which uses npm), it will also bundle your dependency with it.

If the package is on a personal fork of a project on github, npm also can pull directly from a git url. Check out http://npmjs.org/doc/ for more information on ways to pull npm modules from non-registry sources.

Also: We have a dedicated support team which can be contacted either through support@nodejitsu.com or at #nodejitsu on irc.freenode.net .

Josh Holbrook
  • 1,611
  • 13
  • 10
  • When I go to deploy all of the dependencies for the bundled dependency are missing, is this normal? It has it's own package.json but none of those are getting pulled in. – fancy May 22 '12 at 04:33
0

Have you tried using npm programmatically? The docs give the following 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
})

You can find the full docs here: https://github.com/isaacs/npm/blob/master/README.md

So in your case maybe you do: (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 drop by the IRC room. The people there are very helpful.

Swift
  • 13,118
  • 5
  • 56
  • 80
  • No this isn't the answer. I'm talking about npm linking something not found in the npm repo. I'm also speaking specifically about a nodejitsu instance, not in general. The problem is that I can't ssh to this instance, at least to my knowledge. – fancy Feb 16 '12 at 06:06
  • A little more background would help. What exactly are you trying to link? If its a javascript package that you just don't want to publish, you could always add it as a private repo dependency. – Swift Feb 16 '12 at 06:19
  • see bundledDependencies above – fancy Feb 16 '12 at 06:51