Reputation: 1401
I have trouble upgrading Node.js.
Currently, I have node --version
"v0.8.18" and I would like to upgrade to the latest "v0.10.20". So I followed some answers that does not include NVM, since I want to know how to do it from scratch. However, after trying, I still get node --version
"v0.8.18".
I am on an Ubuntu 11.04 machine, on my home directory.
Specifically I did:
Try 1:
alice@simba:~$ node --version
v0.8.18
alice@simba:~$ sudo n stable
sudo: n: command not found
alice@simba:~$ sudo npm install n -g
npm http GET https://registry.npmjs.org/n
npm http 200 https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/n/-/n-1.1.0.tgz
npm http 200 https://registry.npmjs.org/n/-/n-1.1.0.tgz
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
[email protected] /usr/lib/node_modules/n
alice@simba:~$ sudo n stable
install : 0.10.20
mkdir : /usr/local/n/versions/0.10.20
fetch : http://nodejs.org/dist/v0.10.20/node-v0.10.20-linux-x64.tar.gz
...
...#############/usr/bin/node
installed : v0.10.20
alice@simba:~$ node --version
v0.8.18
Try again:
alice@simba:~$ npm cache clean -f
alice@simba:~$ sudo npm install n -g
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
[email protected] /usr/local/lib/node_modules/n
alice@simba:~$ n stable
/usr/local/bin/node
alice@simba:~$ sudo n stable
/usr/local/bin/node
alice@simba:~$ node --version
v0.8.18
Upvotes: 1
Views: 2139
Reputation: 3064
I use nvm
myself, but something I've bumped up against in the past is that installing a version and selecting a version as active are different operations.
It may be that your new version is installed but not currently the default. Try:
n use 0.10.20
Upvotes: 2