How to run TopoJSON?

I need to convert a geojson file to topojson and possibly simplify the topojson file. I've managed to install Node.js and the topojson package. But I have no idea how to run topojson.

The wiki lists a bunch of command line options, but where do I run those commands? I've tried running them both in the command prompt and the node shell. Node, GDAL, ogr2ogr and TopoJSON are all new concepts for me, so I'm a bit confused and overwhelmed.

I'm running on Windows by the way.

this should work fine on windows too

  1. install nodejs http://nodejs.org/
  2. install npm https://npmjs.org/doc/README.html
  3. run npm install -g topojson in your command prompt
  4. use the command prompt to cd to the geojson file
  5. run topojson -o myNewTopojsonFile.json myOldGeojsonFile.json

origin http://gis.stackexchange.com/questions/45138/convert-geojson-to-topojson

I had the same issue on Ubuntu 14.04.

I found that my node.js executable is called nodejs instead of node.

I opened the topojson script (usr/bin/topojson) and found that it was trying to run topojson with a node executable called node.

#!/usr/bin/env node

I edited this file so that it runs with nodejs instead

#!/usr/bin/env nodejs

and now it works fine for me.

Hope this helps someone else.