Should we use package.json for websites

50 views
Skip to first unread message

Matt

unread,
Jun 4, 2011, 1:39:01 PM6/4/11
to Express
Is it advisable to use package.json to track dependenices for my
Express website and how would this work?

Lets say I have a git push hook that after deployment checkout to /
home/matt/websites/jokesite1/, how do I tell npm to analyze that
package.json and satisfy the dependencies without installing elsewhere
or globally etc..

Joshua Cohen

unread,
Jun 4, 2011, 2:56:48 PM6/4/11
to expre...@googlegroups.com
I use a package.json for dependency management, with the private flag set to true ensure it doesn't accidentally get published. If you have npm installed on the host, then it's just a matter of running "npm install ." from the root of your app, and npm will download/install all of the dependencies into the local node_modules for your app.


--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.


vision media [ Tj Holowaychuk ]

unread,
Jun 4, 2011, 3:23:44 PM6/4/11
to expre...@googlegroups.com
we use package.json as well. I created ndistro for this reason, which has the added benefit of installing pre-compiled node binaries so it's muuuuuuuuch faster, but it does not handle dependencies as nice as npm, and the binaries are annoying to manage, I had hoped that Joyent would expose their buildbot binaries but nope
--
Tj Holowaychuk
Vision Media
President & Creative Lead

Tom

unread,
Jun 4, 2011, 3:34:30 PM6/4/11
to expre...@googlegroups.com
Personally I wouldn't dare to publish private (and sensitive) projects with npm, what if they accidentally become public? For example because of a typo in package.json.

Tom

2011/6/4 vision media [ Tj Holowaychuk ] <t...@vision-media.ca>

TJ Holowaychuk

unread,
Jun 4, 2011, 3:36:23 PM6/4/11
to expre...@googlegroups.com
you don't have to, we just use it for open-source deps, which just happens to be all of our deps, but it's easy enough to place a closed-source dep in node_modules

-- 
TJ Holowaychuk
Reply all
Reply to author
Forward
0 new messages