Stupid Question - NodeJS Update/Upgrade 0.10.29->4.1.1

Technical Support
  • Hi everyone, I am a fresh NodeJS user so please bare with me.
    I have NodeBB installed - everything is running,
    but I have the fear that I use an old NodeJS version.

    When I type node in the console - and process.version I get v0.10.29,
    now I want to upgrade this to at least 4.1.1

    Now everywhere I see "its so easy to update NodeJS through NPM"
    like these commands:

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable

    Yeah, NodeJS installs in a higher version - but when I do the node process-versions command I get v0.10.29 back and nothing changed.

    Can anyone enlighten me? Thanks a lot 🙂

  • Okay what I now have done is replacing the node executable from the /usr/local/n/versions/4.4.1/ folder in the /usr/bin/ folder,
    now the process.versions is showing me 4.4.1!

    Is this the way it should be? Only replacing the executable and everything is fine? Or did i miss something?

    And which NodeJS version do you recommend for NodeBB at the moment? Thanks!

  • Hello, welcome to NodeBB!

    NodeBB will run perfectly fine on node versions as low as 0.10, there is maybe only a very smaller number of third-party plugins that may require node 4.

    You have installed a Node Version Manager called n which does indeed make it easy to change node versions. n does this by copying the files from it's directory to /usr/bin/ when you use it's commands. The reason you had to do this manually probably has to do with a permissions issue.

    You are running all your commands as sudo, when none of them should be run with sudo, this can cause permissions issues and is possibly a security risk. Unfortunately, it may be too late to correct this problem. Next time, check here if you run into any issues when not using sudo.

Suggested Topics