Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Update Node-js V4.x auf V6.x

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Update Node-js V4.x auf V6.x

    This topic has been deleted. Only users with topic management privileges can see it.
    • apollon77
      apollon77 last edited by

      @Fitti:

      @apollon77:

      Ich denke ab April sollten wir die 6.x als "Empfehlung" setzen und die 4.x als "geht auch noch für mind 1 Jahr) 🙂 `
      Macht mir natürlich sorgen.

      …

      Ich bitte es nochmal wirklich zu durchdenken, ob nun der eine neue gute Befehl, der mit 10 weiteren Codezeilen auch so erledigt werden kann, das rechtfertigt. Es steigt auch nicht jeder gleich auf Windows 10 um.

      Oft ist es doch nur die Detailverliebtheit von Programmierern und nicht die technische Notwendigkeit. Das kenne ich aus vielen beruflichen Situationen genauso. Admins und Entwicklung streiten oft über die Ansichten.

      Letztendlich verliert immer nur der User/Kunde. `

      Valide Sichtweise und ich kann Dir versichern das denke keiner der Entwickler absichtlich Nutzer aussperren wird - vor allem nicht für bestehende Funktionen. Auch wenn die "Empfehlung für neue Installation" (so bezeichne ich es mal) höher ist ändert sich nicht so viel.

      Man muss aber auch sagen das halt node 0.x im Speichermanagement einige Probleme hatte, es mit 4.x besser ist und 6.x nochmal besser sein soll.

      Als Entwickler im nodejs-Umfeld muss man aber auch die Abhängigkeiten berücksichtigen. Man baut nicht alles selbst sondern nutzt Libraries. Wenn man also Funktionen nicht selbst bauen will und eine Library findet kann es sein das diese schon eine node-Limitierung vorgibt. Ich baue gerade einen Adapter um Smartmeter per SML auszulesen und da gibt es eine Library die ich nutzen kann für das Protokoll. Diese ist aber erst ab node 4.x funktionsfähig … und schon ist das Limit da ... entweder ich baue das jetzt selbst nochmal nach oder ich überzeuge den Library-Entwickler das umzubauen oder ich akzeptiere es ... Schwierig ... 🙂

      Naja, wir schauen einfach mal wie es weitergeht und nehmen jedes Feedback von "falschen" Abhängigkeiten und versuchen Sie weg zu machen ,,,

      1 Reply Last reply Reply Quote 0
      • apollon77
        apollon77 last edited by

        @fsjoke:

        Ich habe das original-script für Linux etwas abgeändert: `

        Ich habe auch mal ein bissl gespielt und komme mit den Ideen aus dem Thread hier zu folgendem:

        iobroker stop
        BASE=$(pwd)
        
        if [ -d ./node_modules ]
        then
            ls -1 ./node_modules | grep iobroker. > reinstall.list.txt
            chmod 777 * -R
            cd node_modules
            rm -R *
            pwd
        
            while read IN
            do
                npm install $IN --production
                if [ $? -eq 0 ]
                then
                    if [ -d ./node_modules/$IN ]
                    then
                        cd node_modules/$IN/
                        npm install --production
                        cd "$PWD"
                    fi
                    echo "DONE $IN"
        
                else
                    echo "FAIL $IN"
                fi
        
            done < "$BASE/reinstall.list.txt"
            chmod 777 * -R
            rm "$BASE/reinstall.list.txt"
            iobroker upload all
        fi
        
        

        bisher trocken auf meinem Rechner mit nem projekt getestet … muss ich heute Abend mal auf meinen iobroker-Testhost loslassen.

        Andere Tester wilkommen 🙂

        Ingo F

        1 Reply Last reply Reply Quote 0
        • frankjoke
          frankjoke last edited by

          Nur 'ne Frage Ingo,

          warum rufst du install 2x auf?

          ! ````
          npm install $IN --production
          if [ $? -eq 0 ]
          then
          if [ -d ./node_modules/$IN ]
          then
          cd node_modules/$IN/
          npm install --production

          
          Das 1\. install installiert schon alles und man muss nicht nochmal ins Verzeichnis des Modules reingehen um es nochmal zu installieren!
          
          Der effekt (bei älteren npm's) ist nur dass module 2x heruntergeladen werden, einmal in ioboker/node_modules und einmal in iobroker/node_modules/iobroker.adapter/node_modules
          
          Der Sinn von Node/npm ist alle Modulversionen in einem Projekt nur einmal lokal zu speichern.
          
          Egal, ich weiß nicht wann damit angefangen wurde, aber es war wahrscheinlich als jemand Probleme hatte unterschiedliche Versionen auf unterschiedliche Weise zu installieren (einmnal im iobroker Hauptverzeichnis und einmal im Adapter) was dann dazu führt dass die falschen Module geladen werden!
          
          Deshalb verwende ich falls ich in einem anderen Verzeichnis als /opt/iobroker installiere immer  ` > –prefix "/opt/iobroker" `  um nicht ein neues node_modules anzufangen.
          1 Reply Last reply Reply Quote 0
          • apollon77
            apollon77 last edited by

            Diese Frage kann wohl nur Bluefox beantworten. Ich hab an der Stelle das gleiche gemacht wie das Skript davor. Ich habe es nur etwas "Fehlersicherer" gemacht … Die Frage ist aber komplett gerechtfertigt. Ich sehe es auch eher unnötig das doppelt zu machen.

            @Bluefox: Any comment to this?

            1 Reply Last reply Reply Quote 0
            • Bluefox
              Bluefox last edited by

              @apollon77:

              Diese Frage kann wohl nur Bluefox beantworten. Ich hab an der Stelle das gleiche gemacht wie das Skript davor. Ich habe es nur etwas "Fehlersicherer" gemacht … Die Frage ist aber komplett gerechtfertigt. Ich sehe es auch eher unnötig das doppelt zu machen.

              @Bluefox: Any comment to this? `
              Mit npm 3,4 ist es nicht mehr nötig, aber mit npm 1 es war ein Hacken da, ich kann aber mich nicht mehr daran erinnern 🙂

              1 Reply Last reply Reply Quote 0
              • apollon77
                apollon77 last edited by

                bei node 0.10, 0.12 und 4.x ist ein npm 2.x "dabei". Das 3er npm erst ab node 6.x

                Da nopm 1 damit nirgends mehr relevant ist das doppelte rauswerfen?

                @Bluefox: habs mal geändert. Siehe js-controller Pull Request

                1 Reply Last reply Reply Quote 0
                • greyhound
                  greyhound last edited by

                  Habe wegen diverser Probleme meine node-Version von 7.4 (siehe http://forum.iobroker.net/viewtopic.php?f=8&t=4953auf 6.9.5 zurückgestellt und dann das reinstall.sh durchlaufen lassen.

                  Dabei laufe ich bei mehreren Adaptern/Modulen auf folgenden Fehler:

                     SUCCES iobroker.owntracks
                  iobroker.core@0.1.0 /opt/iobroker
                  └── iobroker.ping@1.2.0
                  
                     SUCCES iobroker.ping
                  
                  > usb@1.2.0 install /opt/iobroker/node_modules/usb
                  > node-pre-gyp install --fallback-to-build
                  
                  node-pre-gyp ERR! Tried to download: https://github.com/tessel/node-usb/releases/download/1.2.0/usb_bindings-v1.2.0-node-v48-linux-arm.tar.gz
                  node-pre-gyp ERR! Pre-built binaries not found for usb@1.2.0 and node@6.9.5 (node-v48 ABI) (falling back to source compile with node-gyp)
                  make: Entering directory '/opt/iobroker/node_modules/usb/build'
                  . . . 
                  
                  

                  Aber auch ein build aus den Sourcen schlägt fehl.

                  Ursache ist, dass es in dem Repo kein Paket für node v6.9 gibt?

                  Ist euch das Problem bekannt und habt ihr einen Workaround dafür?

                  Anderseits frage ich mich, warum so viele Adapter eine Abhängigkeit zu USB haben. Z. B. bekomme ich selbigen Fehler auch beim heutigen Update von icons-open-icon-library-png

                  npm install https://github.com/ioBroker/ioBroker.icons-open-icon-library-png/tarball/master --production --prefix "/opt/iobroker" (System call)
                  node-pre-gyp
                   ERR! Tried to download: https://github.com/tessel/node-usb/releases/download/1.2.0/usb_bindings-v1.2.0-node-v48-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for usb@1.2.0 and node@6.9.5 (node-v48 ABI) (falling back to source compile with node-gyp) 
                  
                  ../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: No such file or directory #include <libudev.h>^
                  compilation terminated.
                  ...</libudev.h> 
                  
                  1 Reply Last reply Reply Quote 0
                  • frankjoke
                    frankjoke last edited by

                    greyhound,

                    Ich würde 7 nur für Tests einsetzten aber hatte mit 4 und 6 auch schon ähnliche Probleme.

                    Die Probleme verschwanden bei mir sobald ich Adapter nur von den npm-repos (also npm install iobroker.adapter und nicht npm install von_git…..) gemacht habe.

                    Noch schlechter war's wenn ich git clones gemacht habe um die Adapter lokal zu bearbeiten/debuggen/und wieder auf upzudaten, dann konnte ich nichts mehr installieren bis ich das Verzeichnis in node_modules gelöscht hab.

                    Habe nach downgrade von 6 auf 4 auch noch ein Problem gehabt dass ich alle npm caches löschen musste und auch ioBroker+Adapter neu installieren musste (komplettes node_modules löschen).

                    1 Reply Last reply Reply Quote 0
                    • apollon77
                      apollon77 last edited by

                      @greyhound:

                      ../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: No such file or directory #include <libudev.h>^

                      compilation terminated.

                      …</libudev.h> `

                      Das liegt an sich nicht an node 6.x/7.x … installiere mal

                      apt-get install libusb-1.0-0.dev libudev-dev
                      

                      Dann sollte das Problem weg sein!

                      1 Reply Last reply Reply Quote 0
                      • greyhound
                        greyhound last edited by

                        Danke für den Hinweis, das hatte ich schon probiert, es kommt aber immer folgender Fehler:

                        The following packages have unmet dependencies:
                         libudev-dev : Depends: libudev1 (= 215-17+deb8u6) but 230-7~bpo8+2 is to be installed
                        E: Unable to correct problems, you have held broken packages.
                        
                        

                        Aber

                        apt-get remove libudev1
                        

                        und ein anschließendes

                        apt-get install libudev-dev
                        

                        Haben das Problem zumindest gelöst.

                        1 Reply Last reply Reply Quote 0
                        • greyhound
                          greyhound last edited by

                          @greyhound:

                          Aber

                          apt-get remove libudev1
                          

                          und ein anschließendes

                          apt-get install libudev-dev
                          

                          Haben das Problem zumindest gelöst. `
                          aber leider nur bis zum nächsten reboot. Musste dann ziemlich umständlich wieder die alten Packages auf das Image kopieren und neu installieren.

                          Gruß

                          GH

                          1 Reply Last reply Reply Quote 0
                          • apollon77
                            apollon77 last edited by

                            hä ?!

                            1 Reply Last reply Reply Quote 0
                            • greyhound
                              greyhound last edited by

                              ach ja,

                              vergaß wohl das wichtigste, mit dem

                              apt-get remove libudev1
                              Remove: libudev1:armhf (230-7~bpo8+2), libdevmapper1.02.1:armhf (1.02.90-2.2+deb8u1), initramfs-tools:armhf (0.120+deb8u2), systemd-sysv:armhf (230-7~bpo8+2), libcryptsetup4:armhf (1.6.6-5), systemd:armhf (230-7~bpo8+2), dmsetup:armhf (1.02.90-2.2+deb8u1), libbluetooth3:armhf (5.23-2+b1), libbluetooth-dev:armhf (5.23-2+b1), udev:armhf (230-7~bpo8+2), bluez:armhf (5.23-2+b1), libusb-1.0-0:armhf (1.0.19-1), usbutils:armhf (007-2), bluetooth:armhf (5.23-2)
                              
                              

                              wird leider etwas mehr entfernt als ich dachte. Und mit

                              apt-get install libudev-dev
                              Install: libudev1:armhf (215-17+deb8u6, automatic), libdevmapper1.02.1:armhf (1.02.90-2.2+deb8u1, automatic), libcryptsetup4:armhf (1.6.6-5, automatic), dmsetup:armhf (1.02.90-2.2+deb8u1, automatic)
                              

                              weniger wieder installiert.

                              Damit fehlte dann so einiges für USB, Bluetooth und auch der systemd. Ohne den systemd startet bei meinem odroid XU4 das Netzwerk nicht mehr, kein eth0.

                              1 Reply Last reply Reply Quote 0
                              • AlCalzone
                                AlCalzone Developer last edited by

                                @Blackmike:

                                apt-get --purge remove node
                                apt-get --purge remove nodejs
                                apt-get autoremove
                                reboot
                                
                                curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
                                sudo apt-get install -y build-essential python nodejs
                                reboot
                                ```` `  
                                

                                Genauso habe ich am Wochenende Versucht, meinen Pi von NodeJS 0.10.22 auf 6.X zu aktualisieren. apt-get war aber der Meinung, dass ich doch lieber 0.10.29 will, obwohl ich explizit eine andere Version angegeben habe.

                                Gelöst habe ich es dann mit dem "n"-Paket:

                                sudo npm install -g n
                                sudo n lts
                                

                                War wesentlich unkomplizierter und hat auf Anhieb funktioniert.

                                1 Reply Last reply Reply Quote 0
                                • Homoran
                                  Homoran Global Moderator Administrators last edited by

                                  @AlCalzone:

                                  apt-get war aber der Meinung, dass ich doch lieber 0.10.29 will `
                                  ist das ein Pi1?

                                  Gruß

                                  Rainer

                                  1 Reply Last reply Reply Quote 0
                                  • AlCalzone
                                    AlCalzone Developer last edited by

                                    Nein, ein Pi2, den ich nach Anleitung aus dem Forum zuvor von Wheezy auf Jessie geupdated habe.

                                    1 Reply Last reply Reply Quote 0
                                    • frankjoke
                                      frankjoke last edited by

                                      Ah ja, original Jessie gibt noch immer 0.1x bei und du hast sicher nicht

                                      curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

                                      oder

                                      curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -

                                      gemacht um die nodejs-source für apt-get auf 6.x oder 4.x umzuistellen.

                                      ioBroker basis läuft auf allen aber es gibt einige Adapter die nur ab 4.x laufen.

                                      1 Reply Last reply Reply Quote 0
                                      • AlCalzone
                                        AlCalzone Developer last edited by

                                        Doch, eben das habe ich gemacht (siehe mein vorletzter Post mit der Problembeschreibung).

                                        Node 6.7 läuft einwandfrei, wollte sich aber eben nicht per apt-get installieren lassen.

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          swordfisch last edited by

                                          bekomme nach dem ich mein node-js von 4 auf 6 gewechselt habe mein iobroker nicht wieder ans laufen kann mir wer helfen????

                                          ! root@iOBroker:/opt/iobroker# ./reinstall.sh
                                          ! module.js:540
                                          ! throw err;
                                          ! ^
                                          ! Error: Cannot find module '/opt/iobroker/node_modules/iobroker.js-controller/iobroker.js'
                                          ! at Function.Module._resolveFilename (module.js:538:15)
                                          ! at Function.Module._load (module.js:468:25)
                                          ! at Function.Module.runMain (module.js:684:10)
                                          ! at startup (bootstrap_node.js:187:16)
                                          ! at bootstrap_node.js:608:3

                                          ioBroker hab ich zumindest teilweise wieder ans laufen bekommen

                                          aber funktionieren tut es immer noch nicht richtig

                                          ! host.iOBroker 2018-01-23 22:19:19.970 info iobroker exit 25
                                          ! host.iOBroker 2018-01-23 22:19:19.967 error iobroker host.iOBroker Cannot install iobroker.radar: 254
                                          ! host.iOBroker 2018-01-23 22:19:19.965 info iobroker npm ERR! /root/.npm/_logs/2018-01-23T21_19_19_942Z-debug.log
                                          ! host.iOBroker 2018-01-23 22:19:19.965 info iobroker npm ERR! A complete log of this run can be found in:
                                          ! host.iOBroker 2018-01-23 22:19:19.965 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.938 info iobroker npm ERR! enoent This is related to npm not being able to find a file.npm ERR! enoent
                                          ! host.iOBroker 2018-01-23 22:19:19.937 info iobroker ERR! enoent ENOENT: no such file or directory, rename '/opt/iobroker/node_modules/npm/node_modules/dezalgo/node_modules/asap' -> '/opt/iobroker/node_modules/npm/node_modules/dezalgo/node_mod
                                          ! host.iOBroker 2018-01-23 22:19:19.936 info iobroker errno -2npm ERR! syscall rename npm
                                          ! host.iOBroker 2018-01-23 22:19:19.936 info iobroker ERR!
                                          ! host.iOBroker 2018-01-23 22:19:19.935 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.931 info iobroker npm
                                          ! host.iOBroker 2018-01-23 22:19:19.931 info iobroker ENOENT
                                          ! host.iOBroker 2018-01-23 22:19:19.930 info iobroker code
                                          ! host.iOBroker 2018-01-23 22:19:19.929 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.929 info iobroker ERR!
                                          ! host.iOBroker 2018-01-23 22:19:19.928 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.927 info iobroker npm
                                          ! host.iOBroker 2018-01-23 22:19:19.926 info iobroker /opt/iobroker/node_modules/npm/node_modules/dezalgo/node_modules/asap
                                          ! host.iOBroker 2018-01-23 22:19:19.926 info iobroker path
                                          ! host.iOBroker 2018-01-23 22:19:19.925 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.925 info iobroker ERR!
                                          ! host.iOBroker 2018-01-23 22:19:19.924 info iobroker
                                          ! host.iOBroker 2018-01-23 22:19:19.923 info iobroker npm
                                          ! host.iOBroker 2018-01-23 22:19:11.779 info iobroker npm install iobroker.radar –production --prefix "/opt/iobroker" (System call)
                                          ! host.iOBroker 2018-01-23 22:19:11.485 info iobroker add radar
                                          ! host.iOBroker 2018-01-23 22:18:57.471 info Update repository "default" under "http://download.iobroker.net/sources-dist.json"

                                          grüße swordfisch

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            swordfisch last edited by

                                            ! root@iOBroker:/opt/iobroker# npm cache clean
                                            ! npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
                                            ! npm ERR!
                                            ! npm ERR! If you're sure you want to delete the entire cache, rerun this command with –force.
                                            ! npm ERR! A complete log of this run can be found in:
                                            ! npm ERR! /root/.npm/_logs/2018-01-23T22_02_57_440Z-debug.log

                                            kann mein ioBroker zwar starten aber viel Adapter gehen nicht mehr bzw installieren sich nicht neu wer kann helfen?

                                            ! root@iOBroker:/opt/iobroker# npm i
                                            ! npm ERR! path /opt/iobroker/node_modules/npm/node_modules/dezalgo/node_modules/asap
                                            ! npm ERR! code ENOENT
                                            ! npm ERR! errno -2
                                            ! npm ERR! syscall rename
                                            ! npm ERR! enoent ENOENT: no such file or directory, rename '/opt/iobroker/node_modules/npm/node_modules/dezalgo/node_modules/asap' -> '/opt/iobroker/node_modules/npm/node_modules/dezalgo/node_modules/.asap.DELETE'
                                            ! npm ERR! enoent This is related to npm not being able to find a file.
                                            ! npm ERR! enoent
                                            ! npm ERR! A complete log of this run can be found in:
                                            ! npm ERR! /root/.npm/_logs/2018-01-23T22_17_23_265Z-debug.log

                                            grüße swordfisch

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            837
                                            Online

                                            31.8k
                                            Users

                                            80.0k
                                            Topics

                                            1.3m
                                            Posts

                                            21
                                            98
                                            19469
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo