Upgrade issues
-
I always seem to have two issues with upgrading Nodebb versions, (I have to go through the process twice before it sticks and possibly Im getting confused with one of the commands.)
-
first issue is checking Im on latest nodejs version
typing node -v shows Im on v18.16.0
typing nodejs -v says v20.12.2
Can anyone explain that -
second issue, doing these steps does not upgrade first time round
./nodebb stop git fetch git reset --hard v3.7.3 ./nodebb upgrade ./nodebb start -l
-
-
@eeeee it sounds like you have two versions of Nodejs installed.
Make sure you're not using anything like n or nvm to install node.js, install it from the node source repositories.
Now that you've ended up with multiple installs you'll need to figure out how to uninstall them.
-
why is the node -v and nodejs -v not returning same thing then. shouldnt the later version have replaced the earlier one?
Im always doing this to get nodejs, as per the upgrade instructions, is this not correct?
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs
-
Those may be the right commands to install and upgrade Node.js, but at some point since you set up your server, you may have run the installation script for
n
ornvm
, and the symlinks are now pointing to the wrong place.What I'd suggest is looking into whether either is installed... you can try running
n
ornvm
to see. If they are, look up their uninstallation commands and run them. -
Just as an update, (incase anyone else has this problem), chatgtp was quite good sorting out, and removing older versions, and said:
The naming difference between node and nodejs primarily stems from historical reasons and package management conventions.
In some Linux distributions, including Debian and its derivatives like Ubuntu, the package for Node.js is named nodejs to avoid a conflict with another package called node. This node package is unrelated to Node.js and is used for a different purpose.
The naming convention was introduced to prevent potential conflicts between Node.js and the unrelated node package. However, this led to confusion for users accustomed to using the node command to execute Node.js scripts. To address this confusion, symbolic links or alternatives are often used to allow the node command to point to the nodejs executable.
While the naming convention can indeed be confusing, it's a result of the need to avoid conflicts and maintain compatibility with existing packages. Efforts have been made to streamline this naming difference in newer versions of Node.js, but it may still persist in certain distributions and setups.