Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
"node_modules" for private modules that need to be committed?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom  
View profile  
 More options Oct 10 2012, 11:09 am
From: Tom <tommed...@gmail.com>
Date: Wed, 10 Oct 2012 08:09:27 -0700 (PDT)
Local: Wed, Oct 10 2012 11:09 am
Subject: "node_modules" for private modules that need to be committed?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diogo Resende  
View profile  
 More options Oct 10 2012, 11:32 am
From: Diogo Resende <drese...@thinkdigital.pt>
Date: Wed, 10 Oct 2012 16:31:36 +0100
Local: Wed, Oct 10 2012 11:31 am
Subject: Re: [nodejs] "node_modules" for private modules that need to be committed?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Barczewski  
View profile  
 More options Oct 10 2012, 11:40 am
From: Jeff Barczewski <jeff.barczew...@gmail.com>
Date: Wed, 10 Oct 2012 08:40:54 -0700 (PDT)
Local: Wed, Oct 10 2012 11:40 am
Subject: Re: "node_modules" for private modules that need to be committed?

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 10 2012, 11:44 am
From: Tom <tommed...@gmail.com>
Date: Wed, 10 Oct 2012 08:44:58 -0700 (PDT)
Local: Wed, Oct 10 2012 11:44 am
Subject: Re: [nodejs] "node_modules" for private modules that need to be committed?

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roly Fentanes  
View profile  
 More options Oct 10 2012, 12:33 pm
From: Roly Fentanes <roly...@gmail.com>
Date: Wed, 10 Oct 2012 09:33:09 -0700 (PDT)
Local: Wed, Oct 10 2012 12:33 pm
Subject: Re: "node_modules" for private modules that need to be committed?

For private github repos

git+ssh://...@github.com:username/repo.git


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mgutz  
View profile  
 More options Oct 10 2012, 1:51 pm
From: mgutz <mario.l.gutier...@gmail.com>
Date: Wed, 10 Oct 2012 10:51:19 -0700 (PDT)
Local: Wed, Oct 10 2012 1:51 pm
Subject: Re: "node_modules" for private modules that need to be committed?

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://...@bitbucket.org:USER/PROJECT.git


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Kocharin  
View profile  
 More options Oct 10 2012, 2:02 pm
From: Alex Kocharin <a...@kocharin.ru>
Date: Wed, 10 Oct 2012 22:02:03 +0400
Local: Wed, Oct 10 2012 2:02 pm
Subject: Re: [nodejs] "node_modules" for private modules that need to be committed?
Tom,
š
If 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.
š
Another way is to put these packages to another folder, say my_modules and invoke node.js with node_path env like that:
NODE_PATH=my_modules node server.js
This way you can safely separate private modules from the public ones.
--
// alex
š
š
10.10.2012, 19:09, "Tom" <tommedema@gmail.com>:
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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julian Gruber  
View profile  
 More options Oct 11 2012, 2:52 am
From: Julian Gruber <misterio...@googlemail.com>
Date: Wed, 10 Oct 2012 23:52:40 -0700 (PDT)
Local: Thurs, Oct 11 2012 2:52 am
Subject: Re: [nodejs] "node_modules" for private modules that need to be committed?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Care  
View profile  
 More options Oct 11 2012, 3:52 am
From: Charles Care <c.p.c...@gmail.com>
Date: Thu, 11 Oct 2012 08:51:42 +0100
Local: Thurs, Oct 11 2012 3:51 am
Subject: Re: [nodejs] "node_modules" for private modules that need to be committed?

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 <misterio...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mariusz Nowak  
View profile  
 More options Oct 11 2012, 4:37 am
From: Mariusz Nowak <mari...@medikoo.com>
Date: Thu, 11 Oct 2012 01:37:39 -0700 (PDT)
Local: Thurs, Oct 11 2012 4:37 am
Subject: Re: "node_modules" for private modules that need to be committed?

Tom:

Have you tried following in .gitignore:

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aseem Kishore  
View profile  
 More options Oct 12 2012, 12:27 pm
From: Aseem Kishore <aseem.kish...@gmail.com>
Date: Fri, 12 Oct 2012 12:27:20 -0400
Local: Fri, Oct 12 2012 12:27 pm
Subject: Re: [nodejs] Re: "node_modules" for private modules that need to be committed?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Isaac Schlueter  
View profile  
 More options Oct 12 2012, 4:36 pm
From: Isaac Schlueter <i...@izs.me>
Date: Fri, 12 Oct 2012 13:36:19 -0700
Local: Fri, Oct 12 2012 4:36 pm
Subject: Re: [nodejs] Re: "node_modules" for private modules that need to be committed?
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »