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?
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.
On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: > 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?
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:
> 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.
> On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: > > 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?
On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote: > 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: > > 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.
> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: > > > 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?
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:
> No, I just drop in the modules I want to vendor and require them directly > from the vendor folder.
> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
>> 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: >> > 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.
>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: >> > > 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?
On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> wrote: > 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:
>> No, I just drop in the modules I want to vendor and require them directly >> from the vendor folder.
>> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
>>> 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: >>> > 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.
>>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: >>> > > 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?
> 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.
> On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> wrote: > > 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:
> >> No, I just drop in the modules I want to vendor and require them directly > >> from the vendor folder.
> >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
> >>> 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: > >>> > 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.
> >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: > >>> > > 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?
On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote: > 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: > > 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.
> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> wrote: > > > 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:
> > >> No, I just drop in the modules I want to vendor and require them > directly > > >> from the vendor folder.
> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
> > >>> 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: > > >>> > 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.
> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: > > >>> > > 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?
> 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
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:
> On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
>> 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: >> > 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.
>> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> wrote: >> > > 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:
>> > >> No, I just drop in the modules I want to vendor and require them >> directly >> > >> from the vendor folder.
>> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
>> > >>> 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: >> > >>> > 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.
>> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> >> wrote: >> > >>> > > 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?
>> 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
> On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
>> 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: >> > 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.
>> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> wrote: >> > > 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:
>> > >> No, I just drop in the modules I want to vendor and require them >> > >> directly >> > >> from the vendor folder.
>> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
>> > >>> 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: >> > >>> > 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.
>> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> wrote: >> > >>> > > 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?
>> > >>> > > >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
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. :)
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:
> 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: > > No I didn't.
> > On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
> >> 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: > >> > 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.
> >> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> > wrote: > >> > > 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:
> >> > >> No, I just drop in the modules I want to vendor and require them > >> > >> directly > >> > >> from the vendor folder.
> >> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
> >> > >>> 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: > >> > >>> > 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.
> >> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> > wrote: > >> > >>> > > 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?
> 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
> 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
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.
On Sun, Dec 4, 2011 at 1:29 PM, Andrew Chilton <chi...@appsattic.com> wrote: > 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:
> 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: > > No I didn't.
> > On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
> >> 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: > >> > 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.
> >> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> > wrote: > >> > > 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:
> >> > >> No, I just drop in the modules I want to vendor and require them > >> > >> directly > >> > >> from the vendor folder.
> >> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
> >> > >>> 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: > >> > >>> > 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.
> >> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> > wrote: > >> > >>> > > 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?
> 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
> 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
> 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.
> On Sun, Dec 4, 2011 at 1:29 PM, Andrew Chilton <chi...@appsattic.com>wrote:
>> 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:
>> 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: >> > No I didn't.
>> > On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
>> >> 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: >> >> > 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.
>> >> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> >> wrote: >> >> > > 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:
>> >> > >> No, I just drop in the modules I want to vendor and require them >> >> > >> directly >> >> > >> from the vendor folder.
>> >> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> wrote:
>> >> > >>> 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: >> >> > >>> > 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.
>> >> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> >> wrote: >> >> > >>> > > 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?
>> 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
>> 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
>> 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
> -- > -- > Marak Squires > Co-founder and Chief Evangelist > Nodejitsu, Inc. > marak.squi...@gmail.com
> -- > 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
On Sun, Dec 4, 2011 at 1:35 PM, Avi Deitcher <a...@deitcher.net> wrote: > 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:
>> 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.
>> On Sun, Dec 4, 2011 at 1:29 PM, Andrew Chilton <chi...@appsattic.com>wrote:
>>> 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:
>>> 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: >>> > No I didn't.
>>> > On Sun, Dec 4, 2011 at 1:20 PM, deitch <a...@deitcher.net> wrote:
>>> >> 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: >>> >> > 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.
>>> >> > On Sun, Dec 4, 2011 at 1:13 PM, Avi Deitcher <a...@deitcher.net> >>> wrote: >>> >> > > 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:
>>> >> > >> No, I just drop in the modules I want to vendor and require them >>> >> > >> directly >>> >> > >> from the vendor folder.
>>> >> > >> On Sun, Dec 4, 2011 at 1:08 PM, deitch <a...@deitcher.net> >>> wrote:
>>> >> > >>> 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: >>> >> > >>> > 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.
>>> >> > >>> > On Sun, Dec 4, 2011 at 12:56 PM, deitch <a...@deitcher.net> >>> wrote: >>> >> > >>> > > 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?
>>> 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
>>> 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
>>> 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
>>> 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
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:
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:
> 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:
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.
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.
> On Sun, Dec 4, 2011 at 11:36 PM, Andrew Chilton <chi...@appsattic.com> > wrote:
>> 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:
On Sunday, December 4, 2011, Andrew Chilton <chi...@appsattic.com> wrote: > 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.
> 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
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.
On Mon, Dec 5, 2011 at 1:32 AM, Andrew Chilton <chi...@appsattic.com> wrote: > 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.
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:
> 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.
> On Mon, Dec 5, 2011 at 1:32 AM, Andrew Chilton <chi...@appsattic.com> wrote: > > 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.
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).
On Mon, Dec 5, 2011 at 3:30 AM, deitch <a...@deitcher.net> wrote: > 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: >> 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.
>> On Mon, Dec 5, 2011 at 1:32 AM, Andrew Chilton <chi...@appsattic.com> wrote: >> > 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.