Skip to content

Windows compatibility #381

wants to merge 26 commits into from

3 participants


Hi Caolan,

I have made some initial progress on Windows support - mostly around path handling. The general issues here is that nodejs on Windows converts all paths to use back-slashes. Given that you are mostly using node-path already I dived in and fixed up everything to use it. I have run all the tests in the project and they all still pass.

My next step is to move over to node-tar and node-gzip for the package management.

I look forward to your feedback.


Kanso member
caolan commented May 11, 2012

Thanks for your work on this! Looks good, I'll start using it and see I run into any issues. Were you able to push an existing app after these changes? (of course, package management wouldn't work)

dch commented May 15, 2012

sounds great! I'd love to give it a whirl at some point. @caolan is node stable enough from your perspective wrt kanso, to roll a kanso + node + couch windows package?

Kanso member
caolan commented May 15, 2012

@dch I think node would be stable enough, but my experience on windows is very limited. Certainly, Kanso will need some more work before a windows release. A kanso + node + couch package would be fantastic though :D

dch commented May 15, 2012
petebacondarwin added some commits May 15, 2012
@petebacondarwin petebacondarwin Fixed up a few lint errors and used resolve rather than __dirname in …

Added mkdirp node module to replace shell spawn to mkdir, since this didn't play nice in Windows.
@petebacondarwin petebacondarwin Forgot to change one of the uses of env to environment and remove lea…
…ding slash from relative path for use in resolve.
@petebacondarwin petebacondarwin Added debug versions of cmd files to help with debugging (surprisingl…
…y enough).
@petebacondarwin petebacondarwin testapps.js tests now passing on Windows
Forgot to require the 'env' module in packages.
Fixed up a couple of lint errors.
Added a check for no output from kanso show to the test.
@petebacondarwin petebacondarwin Resolve and rimraf
Fixed up some manual path handling to use path.resolve()
Removed shell call to rm -rf and replaced with nodejs module rimraf.
@petebacondarwin petebacondarwin Transform tests passing on Windows.
Added a .gitattributes file to specify that the fixture data files should not have the line endings modified by git.
Fixed a couple of lint errors.
@petebacondarwin petebacondarwin kanso install working on Windows e316a74
@petebacondarwin petebacondarwin Fixed some resolves in cache. 3e505d6
@petebacondarwin petebacondarwin Created kanso package Directory Reader (called Packer in lib/packer.js)
This uses the same technology as npm to stream through directories only picking up the files we want in the package.
Included a new set of tests in test-packer.js for this.
Haven't wired this up to the tar.js yet.
@petebacondarwin petebacondarwin Test now uses set equality to account for difference in ordering 4abe6bc
@petebacondarwin petebacondarwin Fixed up bundled dependencies in the packer and initial cut at tar 3f81da6
@petebacondarwin petebacondarwin Added inner package to bundled dependency 0e32463
@petebacondarwin petebacondarwin Added in fstream dependency ac2961a
@petebacondarwin petebacondarwin Renamed Packer to PackageDirReader a9fc6d1
@petebacondarwin petebacondarwin Updated test-pack to use built in tar extractor as this doesn't work …
…on Windows

I have stripped out all the command line use of tar and gzip, replacing them with the node modules used in npm.
I appear to have all the unit tests passing on both Windows and Ubuntu. (I don't have access to a Mac).
Also I can install and push on Windows.

There is one problem I have not been able to fix yet. When kanso packs up a package I can't get the node-tar module to transform the path of the files to prefix the "package" on the front. I have added an Issue to the node-tar repos to add this feature. It is a shame that it is needed, since rather than including package folder in the tarball it would have been easier to leave it out and then ensure that the cache unpacked the tarball into the package folder itself. But since there are loads of packages out there it would break them all to change this now.

Let me know what you think.


Kanso member
caolan commented May 22, 2012

@petebacondarwin In order to get the top-level 'package' directory in the tar.gz files, I think you should be prefixing the path on entry.path in lib/package-dir-reader.js before it emits an 'entry' event...

dch commented May 22, 2012

OK, so I have fixed up the package folder problem and all the unit tests pass on both Windows (7) and Ubuntu (11.10).
I believe we now have a working kanso on both windows and unix.
Take it for a spin.


No one actually uses this.


Here is the transform to the path.


Added back in the requirement that the extracted path includes the "package" folder"


Added an additional file to the basic test package just to check that folders are packaged up correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.