Keep node.js up to date!
Installing topojson on Ubuntu is pretty simple, right?
But what if you’d like to update it and afterwards it is completely wrecked!?! That happened to me yesterday and I’d like to share my experiences with you! Especially you, who is not experienced in working with the node package manager ‘npm’, as I am (or at least was before I had this problem)!
I reported the issue to the developer of topojson (Mike Bostock), but I already had the feeling that it is not a problem on topojson! As he did not report any idea, I knew I have to do it on my own.
After many trials and errors, trying to update other node-modules and some resignations … I remembered that I have read ‘”pre” versions of node cannot be installed’, somewhere. That does not fit to my failure, but maybe it is basically not good to use a ‘pre’ version of node.js.
So I installed a node version manager ‘nvm‘ and updated node to the latest, not ‘pre’, version:
cd ~/Software git clone git://github.com/creationix/nvm.git ~/nvm . ~/nvm/nvm.sh nvm install v0.10.13 nvm use v0.10.13
Now I can simply install topojson as I did before!
sudo npm install -g topojson
But sadly, this helps just for the moment. Opening a new terminal…forces me now to start nvm, before I can call topojson:
. ~/nvm/nvm.sh nvm use v0.10.13
It seems, that topojson is now linked to the ‘node’ version that I’ve installed with ‘nvm’.
Therefore, I re-install node completely. So I
- downloaded node-version 0.10.13, here
- installed it normally:
./configure make sudo make install node -v
- and re-installed topojson
npm install -g topojson
Now, everything is clean again and I can call topojson directly after opening a new terminal, without initialising ‘nvm’!