It came up with the error ‘No Package mongo-10gen available’, but I’ve already added the MongoDB repo to Yum? – Oh its because my virtual machine is 32bit and I’ve added the 64bit repo. A quick change, still not working, a quick ‘yum clean all’ sorts it and all is installed.
I’ve installed MongoVUE to access MongoDB, useful for listing out data and inserting quickly for testing, works well on Windows. I’m using MongoDB with Node, the MongoDB Mongoose library is really good, allowing model schemas for a great MVC base. Out of MySQL, RethinkDB and MongoDB (The databases I’ve used with Node), I’d recommend MongoDB for the best supported database when developing with Node.js.
I’ve been optimising and tweaking my development environment to try and get the most reliable and easy to use setup.
I use Windows, my main development machine is a Sony laptop, from experience trying to install Linux on a laptop will end in tears (especially this one where windows drivers only just work). If someone buys me a Macbook I’ll use it.
For development I’ve learnt a long time ago that windows is not great, missing dependencies, unreliable ports, annoying path problems. A virtual machine it is. I’ve always use CentOS for servers, so continued this for the virtual machine. No GUI needed, and its always good to have the same linux distro on dev and live.
I started by using VirtualBox shared folders to share files from windows. The problem with this is permissions and symlinks, the shared folder inherits the set permission and can’t have per-file or per-folder permissions. Symlinks just can’t exist with windows shared folders. Symlinks are really useful and losing them is a pain, the folder permissions cause problems when going into a live environment with proper permissions.
So I’ve switched to Samba network folders, so I can keep all the advantages of the Linux file system whilst using windows as the development environment.
An important thing to do is map the network location to a drive, this greatly improves the performance of editing files on the virtual machine. Without the mapping there can be a couple of second delays randomly while editing a file in Sublime that can drive you crazy, map the location and all is well.
The Setup – For PHP, Node, Python and Go
Windows 8.1 Sony Laptop
VirtualBox CentOS Linux
Sublime text 3
I rarely shut down the computer, and so the virtual machine chugs along in the background happily. When I do need to reboot or properly shutdown I save the virtual machine state, so its always available instantly or a few seconds of resuming.
The best of both worlds, Linux development with Windows tools and software. I’m sure some people would say I’ve just described OSX. 😉
After starting to develop my own Grunt plugins and using it for all my new projects, a new build system appears. Gulp.js
It uses piping (streams), which is one the most powerful features on Node.js. Allowing you to pipe outputs around different plugins without having to continuously having to write and move around files.
It is also faster than Grunt due to it not writing as many files. There are 237 plugins available at the time of publish, which is great for a build system that’s only recently getting the attention it deserves.
The next project I setup I’ll be testing out Gulp.