FAQ
I've added the node_modules folder to my .gitignore file, which works fine
thanks to NPM Shrinkwrap (after deploying I need to run npm install using
the shrinkwrap.json file).

However, I've got some private modules now that I won't publish to NPM. I
would like to require these modules like the other modules in node_modules.

Unfortunately I cannot put these modules in node_modules, because they'd be
ignored by git, messing with my future deployment.

Where should I place these modules instead? I've been told that editing the
paths variable for node's module lookup is highly unrecommended.

Note that these are small undocumented nonpublic modules, which is why I
don't want to publish them to NPM.

Tom

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Diogo Resende at Oct 10, 2012 at 4:26 pm
    You have 2 choices:

    1. Change your .gitignore
    2. Change your require() calls

    Example for 1:
    (instead of having "node_modules")

    node_modules/a
    node_modules/b
    ...

    Example for 2:
    (in case you put your module in priv_modules)

    var xpto = require("./priv_modules/xpto");

    --
    Diogo Resende

    On Wednesday, October 10, 2012 at 16:09 , Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works fine thanks to NPM Shrinkwrap (after deploying I need to run npm install using the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I don't want to publish them to NPM.

    Tom

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com (mailto:nodejs@googlegroups.com)
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com (mailto:nodejs+unsubscribe@googlegroups.com)
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Tom at Oct 10, 2012 at 11:04 pm
    Thanks.

    I think I will simply go with changing my .gitignore to list all NPM
    published modules, assuming this is acceptable behavior.

    Tom

    Op woensdag 10 oktober 2012 22:32:13 UTC+7 schreef Diogo Resende het
    volgende:
    You have 2 choices:

    1. Change your .gitignore
    2. Change your require() calls

    Example for 1:
    (instead of having "node_modules")

    node_modules/a
    node_modules/b
    ...

    Example for 2:
    (in case you put your module in priv_modules)

    var xpto = require("./priv_modules/xpto");

    --
    Diogo Resende

    On Wednesday, October 10, 2012 at 16:09 , Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works fine
    thanks to NPM Shrinkwrap (after deploying I need to run npm install using
    the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com <javascript:>
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com <javascript:>
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Jeff Barczewski at Oct 10, 2012 at 4:44 pm
    If you are ok with putting them in github then you can just add dependency
    that points to a github tarball, for example

    "dependencies": {
    "foo": "https://github.com/USER/foo/tarball/TAG"
    }

    where TAG is a named git tag (version), a branch name, or a commit sha. I
    would recommend using a named git tag (version) for best flexibility.

    Once you have added something to package.json, you can install simply be
    doing `npm install` and it will pull it down from github as a tarball just
    as if it came from npm.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Alex Kocharin at Oct 10, 2012 at 6:30 pm
    Tom,=A0If you want it to be managed by npm, use = git+ssh:// scheme, that works. But there are
    several issues with that. For = example, if you use npm update, it will try to update your
    private package = from repository. And if there's a package with the same name, you will have=
    trouble.=A0Another way is to put these packages to a= nother folder, say my_modules and
    invoke node.js with node_path env like th= at:NODE_PATH=3Dmy_modules node server.jsThis
    way you = can safely separate private modules from the public ones.--
  • Julian Gruber at Oct 11, 2012 at 6:52 am
    use /lib or put modules in a git repo (you can host them yourself too) and reference them with git:// or git+http://.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Charles Care at Oct 11, 2012 at 7:51 am
    I had to do this a couple of months ago, and I found that using a private
    repo for code and building tagged releases using "npm pack" worked well for
    me.

    The company I was working for stored all of its deployment packages in
    Amazon S3. We considered using the git+ssh approach, but our general
    approach to managing releases (with other technologies) was to build
    archival packages, so installing from a tarball worked well for us.

    At the time I put together a simple module to support the workflow we were
    using: https://github.com/ccare/node-release-utils

    Cheers,

    Charles
    On 11 October 2012 07:52, Julian Gruber wrote:

    use /lib or put modules in a git repo (you can host them yourself too) and
    reference them with git:// or git+http://.

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Mgutz at Oct 10, 2012 at 6:53 pm
    I suggest using a proper git repository. Use bitbucket.org who provides
    free private repos, and reference them in your package json like this

    git+ssh://git@bitbucket.org:USER/PROJECT.git
    On Wednesday, October 10, 2012 8:09:27 AM UTC-7, Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works fine
    thanks to NPM Shrinkwrap (after deploying I need to run npm install using
    the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Roly Fentanes at Oct 10, 2012 at 7:14 pm
    For private github repos

    git+ssh://git@github.com:username/repo.git
    On Wednesday, October 10, 2012 8:09:27 AM UTC-7, Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works fine
    thanks to NPM Shrinkwrap (after deploying I need to run npm install using
    the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Mariusz Nowak at Oct 11, 2012 at 8:43 am
    Tom:

    Have you tried following in .gitignore:

    node_modules/*
    !node_modules/my-private-package1
    !node_modules/my-private-package2

    On Wednesday, October 10, 2012 5:09:27 PM UTC+2, Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works fine
    thanks to NPM Shrinkwrap (after deploying I need to run npm install using
    the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Aseem Kishore at Oct 12, 2012 at 6:20 pm
    Surprised no one has mentioned this yet:

    You can .gitignore node_modules but still manually check in files under
    node_modules. Git will just ask you to add a -f flag if you really mean to
    check those in.

    We do this for our own private modules. (Actually, what we check into
    node_modules are just symlinks. Our modules live in their own directories
    alongside the requiring module.)

    Aseem
    On Thu, Oct 11, 2012 at 4:37 AM, Mariusz Nowak wrote:

    Tom:

    Have you tried following in .gitignore:

    node_modules/*
    !node_modules/my-private-package1
    !node_modules/my-private-package2

    On Wednesday, October 10, 2012 5:09:27 PM UTC+2, Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works
    fine thanks to NPM Shrinkwrap (after deploying I need to run npm install
    using the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Isaac Schlueter at Oct 12, 2012 at 8:44 pm
    You can also put something like this in .gitignore:

    ```.gitignore
    node_modules
    !node_modules/foo
    ```

    and it'll ignore everything in node_modules *except* node_modules/foo.

    On Fri, Oct 12, 2012 at 9:27 AM, Aseem Kishore wrote:
    Surprised no one has mentioned this yet:

    You can .gitignore node_modules but still manually check in files under
    node_modules. Git will just ask you to add a -f flag if you really mean to
    check those in.

    We do this for our own private modules. (Actually, what we check into
    node_modules are just symlinks. Our modules live in their own directories
    alongside the requiring module.)

    Aseem
    On Thu, Oct 11, 2012 at 4:37 AM, Mariusz Nowak wrote:

    Tom:

    Have you tried following in .gitignore:

    node_modules/*
    !node_modules/my-private-package1
    !node_modules/my-private-package2

    On Wednesday, October 10, 2012 5:09:27 PM UTC+2, Tom wrote:

    I've added the node_modules folder to my .gitignore file, which works
    fine thanks to NPM Shrinkwrap (after deploying I need to run npm install
    using the shrinkwrap.json file).

    However, I've got some private modules now that I won't publish to NPM. I
    would like to require these modules like the other modules in node_modules.

    Unfortunately I cannot put these modules in node_modules, because they'd
    be ignored by git, messing with my future deployment.

    Where should I place these modules instead? I've been told that editing
    the paths variable for node's module lookup is highly unrecommended.

    Note that these are small undocumented nonpublic modules, which is why I
    don't want to publish them to NPM.

    Tom
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedOct 10, '12 at 4:04p
activeOct 12, '12 at 8:44p
posts12
users11
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase