22 12 / 2010
Q : Best Practices with Package Management?
Having been introduced to package management last week, I want to make sure I’m getting properly setup with node & projects in general. My workflow has been a bit chaotic up to this point. Basically it was, ‘If it worked, then run with it’ which obviously isn’t the right way to do things.
How do you have your projects organized on your local machine?
How do you start a new project?
On my local machine, I have a directory, ‘Code,’ where I store all of my projects. It basically is a crazy mess of folders. When I start a new project, I create a new directory, and just throw everything in there. This seemed to work for GAE and Django projects.
However when using package management, how do you start a new project?
Funny enough, a week ago yesterday there was a Node.js Camp here in San Francisco. Doh! I missed it by one week!
For the Camp, there was ‘Homework’ to get node running on your local machine.
- Install node
- Install npm (node package manager)
- Install socket.io
I was able to get all of this installed - but ran into a hickup when installing Socket.io. The first time, I used npm to grab the package, and install it.
npm install connect socket.io
It took me a few minutes to figure out where it had installed-
/usr/local/lib/node
But as I’m still inexperienced with packages, I didn’t know how to use it. :/ I went back to Github, and cloned a copy to my ‘Code’ directory.
git clone https://github.com/LearnBoost/Socket.IO.git
This worked, and I was able to run the Socket.io example, but I am still interested in learning the ‘best practice.’ How do you use the version that was installed through npm? Basically, what is the right way to use package management?
Thanks in advance! I think a lot of n00bs don’t know about package management, but it seems like a great tool that most should learn - sooner rather than later.
Efficiency is doing things right; effectiveness is doing the right things. - Peter Drucker