14 Replies Latest reply on Jul 14, 2020 3:37 PM by Rossoreed

    Oracle Linux server v7.8 update node.js to ver 12

    Rossoreed

      I'm running Oracle Linux Server release 7.8, and need ver 12 of node.js installed for an application.

      I currently have nodejs-10.21.0-1 - nodesource.x86_64 already installed, but having followed this guidance, I still can't get ver 12.x despite it being listed in the repo.

       

      $ sudo yum install -y oracle-nodejs-release-el7 oracle-release-el7

      Package oracle-nodejs-release-el7-1.0-5.el7.x86_64 already installed and latest version

      Package oracle-release-el7-1.0-3.el7.x86_64 already installed and latest version

      Nothing to do

       

      $ sudo yum update oracle-nodejs-release-el7

      No packages marked for update

       

      $ sudo yum update --disablerepo=ol7_developer_EPEL nodejs

      No packages marked for update

       

      $ node -v

      v10.21.0

       

      I'm pretty new to Oracle Linux and it would be great if anyone could help please.

        • 1. Re: Oracle Linux server v7.8 update node.js to ver 12
          Avi Miller-Oracle

          Try this:

           

          # yum-config-manager --disable ol7_developer_nodejs10
          # yum-config-manager --enable ol7_developer_nodejs12
          # yum update
          
          • 2. Re: Oracle Linux server v7.8 update node.js to ver 12
            Rossoreed

            I have just tried that, but it still has not changed anything, I still get node.js v10.21

             

            $ sudo yum-config-manager --disable ol7_developer_nodejs10

            - reply was pretty lengthy, but...

             

            $ sudo yum-config-manager --enable ol7_developer_nodejs12

            Loaded plugins: langpacks

             

            $ sudo yum update

            Loaded plugins: langpacks, ulninfo

            No packages marked for update

             

            $ node -v

            v10.21.0

            • 3. Re: Oracle Linux server v7.8 update node.js to ver 12
              Avi Miller-Oracle

              The yum-config-manager --enable ol7_developer_nodejs12 command should've output as much text as the disable command for ol7_developer_nodejs10.

               

              What's the output of cat /etc/yum.repos.d/oracle-nodejs-ol7.repo on that machine?

               

              You should have this stanza in that file:

               

              [ol7_developer_nodejs12]
              name=Oracle Linux $releasever Node.js 12 Packages for Development and test ($basearch)
              baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL7/developer/nodejs12/$basearch/
              gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
              gpgcheck=1
              enabled=1
              priority=20
              

               

              If you don't, just add it and try again.

              • 4. Re: Oracle Linux server v7.8 update node.js to ver 12
                Dude!

                Probably also useful is yum repolist --enabled and --disabled to see what repositories are enabled and disabled.

                • 5. Re: Oracle Linux server v7.8 update node.js to ver 12
                  Rossoreed

                  Thanks Avi Miller-Oracle

                  The output of cat /etc/yum.repos.d/oracle-nodejs-ol7.repo did not include the [ol7_developer_nodejs12] Stanza so I added it manually and rebooted.

                  I then ran  $ sudo yum update and the resultant printout included ol7_developer_nodejs12 so far so good!

                  I then ran $ sudo yum update --disablerepo=ol7_developer_EPEL nodejs which gave me 'No packages marked for update'

                  $ sudo node -v again resulted in 'No packages marked for update'

                  I also tried $ sudo yum install nodejs but same result.

                   

                  Dude! I tried $ sudo yum repolist --enabled & disabled and both gave me similar messages 'Command line error: no such option: --enabled'

                  But $ sudo yum repolist gave me;

                  repo.JPG

                  • 6. Re: Oracle Linux server v7.8 update node.js to ver 12
                    Avi Miller-Oracle

                    You have a "nodesource" repo enabled which is possibly confusing things further. I have no idea what's in that. Can you try "sudo yum update --disablerepo=ol7_developer_EPEL --disablerepo=nodesource update nodejs" and see what happens?

                    • 7. Re: Oracle Linux server v7.8 update node.js to ver 12
                      Rossoreed

                      This is what I get;

                      $ sudo yum update --disablerepo=ol7_developer_EPEL --disablerepo=nodesource update nodejs

                      Loaded plugins: langpacks, ulninfo

                      ol7_UEKR5                                                                                        | 2.8 kB  00:00:00

                      ol7_addons                                                                                        | 2.8 kB  00:00:00

                      ol7_developer                                                                                    | 2.8 kB  00:00:00

                      ol7_developer_nodejs12                                                                    | 2.8 kB  00:00:00

                      ol7_ksplice                                                                                         | 2.8 kB  00:00:00

                      ol7_latest                                                                                           | 3.4 kB  00:00:00

                      ol7_oci_included                                                                                | 2.9 kB  00:00:00

                      ol7_optional_latest                                                                             | 2.8 kB  00:00:00

                      ol7_oracle_instantclient                                                                     | 2.8 kB  00:00:00

                      ol7_software_collections                                                                   | 2.8 kB  00:00:00

                      (1/3): ol7_addons/x86_64/primary_db                                              | 155 kB  00:00:00

                      (2/3): ol7_developer/x86_64/primary_db                                          | 554 kB  00:00:00

                      (3/3): ol7_latest/x86_64/primary_db                                                 |  24 MB  00:00:00

                      No Match for argument: update

                      No package update available.

                      No packages marked for update

                       

                      [opc@digitalnut images]$ node -v

                      v10.21.0

                      • 8. Re: Oracle Linux server v7.8 update node.js to ver 12
                        Avi Miller-Oracle

                        So, I'm starting to realise you probably didn't install Node.js from our repos, but from that Nodesource repo we just disabled. Can you please run "yum info nodejs" and provide the output?

                        1 person found this helpful
                        • 9. Re: Oracle Linux server v7.8 update node.js to ver 12
                          Rossoreed

                          You may be correct;

                           

                          [opc@digitalnut images]$ yum info nodejs

                          Loaded plugins: langpacks, ulninfo

                          Installed Packages

                          Name        : nodejs

                          Arch        : x86_64

                          Epoch       : 2

                          Version     : 10.21.0

                          Release     : 1nodesource

                          Size        : 61 M

                          Repo        : installed

                          From repo   : nodesource

                          Summary     : JavaScript runtime

                          URL         : http://nodejs.org

                          License     : MIT and ASL 2.0 and ISC and BSD

                          Description : Node.js is a platform built on Chrome's JavaScript runtime

                                      : for easily building fast, scalable network applications.

                                      : Node.js uses an event-driven, non-blocking I/O model that

                                      : makes it lightweight and efficient, perfect for data-intensive

                                      : real-time applications that run across distributed devices.

                          • 10. Re: Oracle Linux server v7.8 update node.js to ver 12
                            Avi Miller-Oracle

                            Yep, that's the issue. This should work:

                             

                            # yum remove nodejs
                            # yum --disablerepo=nodesource install nodejs
                            

                             

                            The "Epoch: 2" value is higher than both EPEL and our Node.js repos, which is why it's winning the version wars, even though the actual version is lower. You may also want to remove any nodesource release RPM (or repo file).

                            1 person found this helpful
                            • 11. Re: Oracle Linux server v7.8 update node.js to ver 12
                              Rossoreed

                              I've just tried the above, and it's installed node v6.17.1 from the repo - ol7_developer_EPEL so now I'm going backwards!

                              How do I remove nodesource release npm (or repo file)

                              • 12. Re: Oracle Linux server v7.8 update node.js to ver 12
                                Rossoreed

                                I think I got there in the end!!

                                 

                                $ sudo yum remove nodejs

                                $ sudo yum --disablerepo=nodesource --disablerepo=ol7_developer_EPEL  install nodejs

                                 

                                $ node -v

                                v12.18.2

                                 

                                Thank you so much for your help & guidance, I would never have found the solution myself.

                                • 13. Re: Oracle Linux server v7.8 update node.js to ver 12
                                  Avi Miller-Oracle

                                  Whoops, yes. I forgot to disable the EPEL repo as well in my example. Glad you got it sorted!

                                  • 14. Re: Oracle Linux server v7.8 update node.js to ver 12
                                    Rossoreed

                                    In fact just to finalise this thread, I found out that the nodesource version of npm had been installed by node-RED, using their rpm installation script.

                                    The script had not been updated to node.js v12 and therefore every time that the script was run (updates, repairs, etc) npm was replaced with v10 from the nodesource repo.

                                     

                                    The script has now been updated, and all is well!!