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
What do people do for versionizing node modules within git?
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
  Messages 1 - 25 of 26 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
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
 
deitch  
View profile  
 More options Dec 4 2011, 3:56 pm
From: deitch <a...@deitcher.net>
Date: Sun, 4 Dec 2011 12:56:52 -0800 (PST)
Local: Sun, Dec 4 2011 3:56 pm
Subject: What do people do for versionizing node modules within git?
You are building an app, it has dependencies on lots of modules that
you install via npm. But versionizing those in git seems redundant.
What do people here do? Do they keep node_modules as tracked part of
git? Or do they put it in .gitignore, and if so, then how do you know
which versions and dependencies you have?

 
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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:03 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:03:58 -0800
Local: Sun, Dec 4 2011 4:03 pm
Subject: Re: [nodejs] What do people do for versionizing node modules within git?

I keep node_modules/ in my .gitignore

npm will let you bundleDeps in node_modules, but I've found it's usually
more straight forward to create an actual "vendor" folder so it's more
explicit.

--
--
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
marak.squi...@gmail.com

 
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.
deitch  
View profile  
 More options Dec 4 2011, 4:08 pm
From: deitch <a...@deitcher.net>
Date: Sun, 4 Dec 2011 13:08:52 -0800 (PST)
Local: Sun, Dec 4 2011 4:08 pm
Subject: Re: What do people do for versionizing node modules within git?
So you manually create a vendor/ folder under the root of your tree,
parallel to node_modules, which has a list of all of the dependencies?
How do you structure it? Is it something automated?

Would it be as effective as every time you run npm install (or
uninstall), to run:

npm ls > vendor.txt

Of course, you need to do it manually. Why doesn't npm have an
automatic "here is a list of all the things currently installed"? It
can be updated by npm every time it runs, say every run of npm install
or uninstall automatically dumps the output of "npm ls" to .npmls or
similar in the same parent dir of node_modules parallel to it. isaacs?

On Dec 4, 11:03 pm, Marak Squires <marak.squi...@gmail.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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:12 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:12:10 -0800
Local: Sun, Dec 4 2011 4:12 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

No, I just drop in the modules I want to vendor and require them directly
from the vendor folder.

--
--
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
marak.squi...@gmail.com

 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 4:13 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Sun, 4 Dec 2011 23:13:56 +0200
Local: Sun, Dec 4 2011 4:13 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

So, you basically ignore the whole npm and node_modules. What does it buy
you? From a git perspective, you are versionizing identically to
node_modules. You just have to explicitly path as opposed to require('foo').

On Sun, Dec 4, 2011 at 11:12 PM, Marak Squires <marak.squi...@gmail.com>wrote:

--
Avi Deitcher
a...@deitcher.net

 
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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:15 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:15:17 -0800
Local: Sun, Dec 4 2011 4:15 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

I feel this this conversation is going in four different directions and no
one understands what the other person is talking about.

I give up.

--
--
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
marak.squi...@gmail.com

 
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.
deitch  
View profile  
 More options Dec 4 2011, 4:20 pm
From: deitch <a...@deitcher.net>
Date: Sun, 4 Dec 2011 13:20:11 -0800 (PST)
Local: Sun, Dec 4 2011 4:20 pm
Subject: Re: What do people do for versionizing node modules within git?
LOL!

Back to earth: when you install modules 3rd-party, npm or vendor or
anyhow, do you put them under version control? You said yes.

On Dec 4, 11:15 pm, Marak Squires <marak.squi...@gmail.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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:24 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:24:42 -0800
Local: Sun, Dec 4 2011 4:24 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

No I didn't.

--
--
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
marak.squi...@gmail.com

 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 4:29 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Sun, 4 Dec 2011 23:29:53 +0200
Local: Sun, Dec 4 2011 4:29 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

Now I *really* am confused. You said you add node_modules to .gitignore,
but you put all of your modules under vendor anyways, and that is under git
control?

On Sun, Dec 4, 2011 at 11:24 PM, Marak Squires <marak.squi...@gmail.com>wrote:

--
Avi Deitcher
a...@deitcher.net

 
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.
Andrew Chilton  
View profile  
 More options Dec 4 2011, 4:29 pm
From: Andrew Chilton <chi...@appsattic.com>
Date: Mon, 5 Dec 2011 10:29:38 +1300
Local: Sun, Dec 4 2011 4:29 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?
I think there are two conversations, but if I clarify what Marak is
saying, that might help.

He uses npm, it puts them in node_modules, this is the best way to do
this with npm installable modules. I don't think this is the issue
here.

@avi ... but if you want to bundle a module which _isn't_ npm
installable, you could put it in a 'vendor' folder, which you _do_
check in to Git

So, for example you might have the following structure:

* myapp.js
* vendor/a-module-that-isnt-npm-installable/*
* vendor/another-module-that-isnt-npm-installable/*
* node_modules/express/*
* node_modules/data2xml/*
* node_modules/everyauth/*

The two vendor folders _are_ checked in to Git. The three node_modules
folder are _not_ checked in. They are installed with npm.

Finally, you might have the following in your .gitignores :

node_modules
*~

Hope that helps,
Andy

On 5 December 2011 10:24, Marak Squires <marak.squi...@gmail.com> wrote:

--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/
p: +64 21 891 681

 
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.
Andrew Chilton  
View profile  
 More options Dec 4 2011, 4:32 pm
From: Andrew Chilton <chi...@appsattic.com>
Date: Mon, 5 Dec 2011 10:32:00 +1300
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?
On 5 December 2011 10:29, Avi Deitcher <a...@deitcher.net> wrote:

> Now I *really* am confused. You said you add node_modules to .gitignore, but
> you put all of your modules under vendor anyways, and that is under git
> control?

He puts the npm installable modules into node_modules. He puts the
non-npm installable modules into vendor.

node_modules is _not_ checked into Git. Vendor is. :)

Does that make sense?

Cheers,
Andy

--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/
p: +64 21 891 681


 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 4:33 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Sun, 4 Dec 2011 23:33:11 +0200
Local: Sun, Dec 4 2011 4:33 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

@Andy,

Clarifies yes. Which opens the original question, though: if you don't
track node_modules in git (which I don't), then what do you use to keep
track of what dependencies you have?

If it is just another npm module, package.json lists all dependencies. But
what about inside an app?

Right now, I just do "npm ls > npmdeps" or some similar file, run it
manually when I remember. And then I can easily reconstruct when I need.

But is there a better way to keep track of which node_modules an app is
dependent upon?

On Sun, Dec 4, 2011 at 11:29 PM, Andrew Chilton <chi...@appsattic.com>wrote:

--
Avi Deitcher
a...@deitcher.net

 
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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:33 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:33:37 -0800
Local: Sun, Dec 4 2011 4:33 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

Yes, exactly.

Sometimes you need a package which isn't available on NPM. This is when I
suggest using /vendor/ folder, although npm does have the ability to bundle
deps for you using the "bundleDependencies" property.

I just haven't had much luck using "bundleDependencies", since it won't
resolve your deps sub-deps.

--
--
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
marak.squi...@gmail.com

 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 4:35 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Sun, 4 Dec 2011 23:35:14 +0200
Local: Sun, Dec 4 2011 4:35 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

Got it. And how do you track which 25 npm packages you needed for your app,
and their versions? Anything better than my kludge of
npm ls > somefile

with somefile under git control?

On Sun, Dec 4, 2011 at 11:33 PM, Marak Squires <marak.squi...@gmail.com>wrote:

...

read more »


 
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.
Marak Squires  
View profile  
 More options Dec 4 2011, 4:36 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Sun, 4 Dec 2011 13:36:09 -0800
Local: Sun, Dec 4 2011 4:36 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

Yeah, use package.json "dependencies" property and npm install?

...

read more »


 
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.
Andrew Chilton  
View profile  
 More options Dec 4 2011, 4:36 pm
From: Andrew Chilton <chi...@appsattic.com>
Date: Mon, 5 Dec 2011 10:36:31 +1300
Local: Sun, Dec 4 2011 4:36 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?
On 5 December 2011 10:33, Avi Deitcher <a...@deitcher.net> wrote:

> @Andy,

> Clarifies yes. Which opens the original question, though: if you don't track
> node_modules in git (which I don't), then what do you use to keep track of
> what dependencies you have?

> If it is just another npm module, package.json lists all dependencies. But
> what about inside an app?

You do exactly the same, just have a package.json file which lists
your dependecies. You check package.json into Git and voila ... you're
tracking your dependencies. :)

For example, a snippet from one of my private projects is as follows:

    "dependencies": {
        "express" : ">= 2.5.1",
        "stylus"  : ">= 0.19.5",
        "jade"    : ">= 0.18.0",
        "passgen" : ">= 1.0.0"
    },

When I do a fresh checkout of my repo, I just do the following and
everything is exactly as I like it:

    $ git checkout myproject
    $ npm -d install

Try that and let me know how it goes.

Cheers,
Andy

--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/
p: +64 21 891 681


 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 4:39 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Sun, 4 Dec 2011 23:39:25 +0200
Local: Sun, Dec 4 2011 4:39 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

As the Genie said in Aladdin (thanks to Robin Williams), "well, I feel
foolish". Or, better yet, Homer Simpson, "Doh!"

I never thought of that, always used package.json when building an npm
installable module, never inside a standalone non-npm-targeted app. Never
even checked it was doable.

You know what would be nice? If every time I ran "npm install" or "npm
uninstall" it automatically updated package.json.

Thanks, Andy and Marak.

On Sun, Dec 4, 2011 at 11:36 PM, Andrew Chilton <chi...@appsattic.com>wrote:

--
Avi Deitcher
a...@deitcher.net

 
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.
Andrew Chilton  
View profile  
 More options Dec 4 2011, 4:50 pm
From: Andrew Chilton <chi...@appsattic.com>
Date: Mon, 5 Dec 2011 10:50:20 +1300
Local: Sun, Dec 4 2011 4:50 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?
On 5 December 2011 10:39, Avi Deitcher <a...@deitcher.net> wrote:

> You know what would be nice? If every time I ran "npm install" or "npm
> uninstall" it automatically updated package.json.

I don't think you'd want it to do that - well, let me rephrase - *I*
wouldn't want it to do that. I want to either be explicit with the
version "= 0.2.0" or less so with a minimum version such as ">=
0.2.0".

In another note, I found something useful in npm which is good for
targeting non-npm modules/applications. Put a "private" : true into
your package.json and it'll help you to stop accidentally uploading it
to npm. :) See http://npmjs.org/doc/registry.html for more info.

Cheers,
Andy

--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/


 
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.
Martin Cooper  
View profile  
 More options Dec 4 2011, 5:16 pm
From: Martin Cooper <mfncoo...@gmail.com>
Date: Sun, 4 Dec 2011 14:16:13 -0800
Local: Sun, Dec 4 2011 5:16 pm
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

On Sun, Dec 4, 2011 at 1:39 PM, Avi Deitcher <a...@deitcher.net> wrote:
> As the Genie said in Aladdin (thanks to Robin Williams), "well, I feel
> foolish". Or, better yet, Homer Simpson, "Doh!"

> I never thought of that, always used package.json when building an npm
> installable module, never inside a standalone non-npm-targeted app. Never
> even checked it was doable.

> You know what would be nice? If every time I ran "npm install" or "npm
> uninstall" it automatically updated package.json.

For install, use 'npm install --save' and it will do that for you. I
don't believe it's supported for uninstall, though.

--
Martin Cooper


 
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.
Avi Deitcher  
View profile  
 More options Dec 4 2011, 6:11 pm
From: Avi Deitcher <a...@deitcher.net>
Date: Mon, 5 Dec 2011 01:11:22 +0200
Local: Sun, Dec 4 2011 6:11 pm
Subject: Re: [nodejs] What do people do for versionizing node modules within git?

Yeah, the more I think about it, th clearer it is that I wan *not* to norm
install, bu rather to modify a package.json an run install against it.

Is it idempotent? Can I add one line, rerun, and have it know to install
just that one added?

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

--
Avi Deitcher
a...@deitcher.net

 
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.
Andrew Chilton  
View profile  
 More options Dec 4 2011, 6:32 pm
From: Andrew Chilton <chi...@appsattic.com>
Date: Mon, 5 Dec 2011 12:32:24 +1300
Local: Sun, Dec 4 2011 6:32 pm
Subject: Re: [nodejs] What do people do for versionizing node modules within git?
Hi Avi,

On 5 December 2011 12:11, Avi Deitcher <a...@deitcher.net> wrote:

> Is it idempotent? Can I add one line, rerun, and have it know to install
> just that one added?

Try it and see. :)

The answer is yes, but seriously, just try it and see. You're using
Git, you're a careful guy, nothing will disappear and even if it did,
your VCS is your backup. :) Experimentation is the key, as is reading
the manual.

Cheers,
Andy

--
Andrew Chilton
e: chi...@appsattic.com
w: http://www.appsattic.com/
p: +64 21 891 681


 
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.
Avi Deitcher  
View profile  
 More options Dec 5 2011, 2:25 am
From: Avi Deitcher <a...@deitcher.net>
Date: Mon, 5 Dec 2011 09:25:10 +0200
Local: Mon, Dec 5 2011 2:25 am
Subject: Re: [nodejs] What do people do for versionizing node modules within git?

My, if that ain't beautiful. I love it... almost as much as that transition
to defense move someone showed me at the hockey rink 2 weeks. Almost.

Thanks, @marak @andy.

--
Avi Deitcher
a...@deitcher.net

 
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.
deitch  
View profile  
 More options Dec 5 2011, 4:30 am
From: deitch <a...@deitcher.net>
Date: Mon, 5 Dec 2011 01:30:59 -0800 (PST)
Local: Mon, Dec 5 2011 4:30 am
Subject: Re: What do people do for versionizing node modules within git?
Well, almost. Because I used ">=" instead of "=", it upgraded my
connect and express when I reran, so I got the newer version of
bodyParser, which killed my extension to "text/plain". I have a simple
one so that the app will *always* find what it wants in req.body -
plaintext, JS objects, whatever - fully parsed. Could have used git to
go backwards, but better to just find it and fix it.

On Dec 5, 9:25 am, Avi Deitcher <a...@deitcher.net> 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.
Tim Caswell  
View profile  
 More options Dec 5 2011, 10:21 am
From: Tim Caswell <t...@creationix.com>
Date: Mon, 5 Dec 2011 09:21:46 -0600
Local: Mon, Dec 5 2011 10:21 am
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?
My simple workflow which works for me is to put all modules in
node_modules.  (Yes, this includes npm installed ones and ones I
install manually)  Then in my .gitignore I list explicitly the folders
for my npm modules (including the trailing /)  I put my dependencies
in a package.json at the root of my app with explicit package
versions.  This way I'm in 100% control of what modules I'm using.
They won't change and break stuff (because node module authors don't
always respect semver semantics).

<https://github.com/c9/nog/blob/master/.gitignore>
<https://github.com/c9/nog/blob/master/package.json#L14-19>
<https://github.com/c9/nog/tree/master/node_modules>

-Tim Caswell


 
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 Dec 5 2011, 11:31 am
From: Jeff Barczewski <jeff.barczew...@gmail.com>
Date: Mon, 5 Dec 2011 08:31:49 -0800 (PST)
Local: Mon, Dec 5 2011 11:31 am
Subject: Re: [nodejs] Re: What do people do for versionizing node modules within git?

Also if you want to install a module that is not in npm but it is in
github, then you can use the tar ball url in your package.json.

For instance to specify a dependency using github tarball either to master
or a particular tag:

"dependencies": {
   "YOURPROJ" : "https://github.com/jeffbski/YOURPROJECT/tarball/master" //
latest
 }

OR

"dependencies": {
   "YOURPROJ" : "https://github.com/jeffbski/YOURPROJECT/tarball/v0.0.1" //
tag v0.0.1
 }

Then just npm install will fetch it


 
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.
Messages 1 - 25 of 26   Newer >
« Back to Discussions « Newer topic     Older topic »