2014년 12월 24일 수요일

nodejs version question

I have a little problem with my nodejs installation, I had the
v0.10.26 of node.js and today I installed the last stable version
v0.10.33, but the command line shows the older one:

$ node -v
v0.10.26

but I notice something curious when installing, it showed something like:
/usr/bin/node refers to /usr/bin/js, don't remember exactly what it
showed, but now if i do the following:

$js -v
v0.10.33

It seems that js is pointing to my last version of node.js, I don't
know how node.js was installed in this pc, but for update node.js i
did:

$ sudo apt-add-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs

My bet is that the previous nodejs was installed from source code and
compiled, now my question is, how can I fix this little problem?



> I have a little problem with my nodejs installation, I had the
> v0.10.26 of node.js and today I installed the last stable version
> v0.10.33, but the command line shows the older one:
>
> $ node -v
> v0.10.26
>
> but I notice something curious when installing, it showed something like:
> /usr/bin/node refers to /usr/bin/js, don't remember exactly what it
> showed, but now if i do the following:
>
> $js -v
> v0.10.33
>
> It seems that js is pointing to my last version of node.js, I don't
> know how node.js was installed in this pc, but for update node.js i
> did:
>
> $ sudo apt-add-repository ppa:chris-lea/node.js
> $ sudo apt-get update
> $ sudo apt-get install nodejs
>
> My bet is that the previous nodejs was installed from source code and
> compiled, now my question is, how can I fix this little problem?
I would suggest that for every way in which you installed nodejs, uninstall it. For example, if you installed nodejs using your package management system, use it to uninstall nodejs. If you built nodejs from source, go back to the source code of that version of nodejs and run "make uninstall" in the source directory. Now you should not have any version of nodejs installed anywhere.

Next, decide how you want to install nodejs from now on (be it from source, or by using your package management system). Install nodejs using that method. Use that method from now on.

If your package management system installs the node binary as "js", that's weird and bound to cause problems. You can create a symlink "node" (in the bin directory of the prefix in which you installed nodejs) pointing to "js" to fix this. You could also ask the maintainers of your package management system why they have done this weird thing.



You may also want to check out Node Version Manager for when you reinstall, https://github.com/creationix/nvm.




Thanks for reply, I solve the problem removing the nodejs files now I
have the last stable version working good!


댓글 없음:

댓글 쓰기