Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test ioBroker Fixer mit JSONL-Compression

    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

    Test ioBroker Fixer mit JSONL-Compression

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mrjeschke @Thomas Braun last edited by

      @thomas-braun
      Wenn ich

      iob diag
      

      eingebe, läuft das Script immer noch ohne Stop durch.

      Thomas Braun 1 Reply Last reply Reply Quote 0
      • Thomas Braun
        Thomas Braun Most Active @mrjeschke last edited by

        @mrjeschke
        Vorher

        iobroker fix
        

        damit der richtige Aufruf geladen wird.

        M 1 Reply Last reply Reply Quote 0
        • M
          mrjeschke @Thomas Braun last edited by

          @thomas-braun
          Alles klar, jetzt läuft es.

          Thomas Braun 1 Reply Last reply Reply Quote 0
          • Thomas Braun
            Thomas Braun Most Active @mrjeschke last edited by

            @mrjeschke
            Und legt dir auch ein Log nach

            /home/iobroker/iob_diag.log

            M 1 Reply Last reply Reply Quote 0
            • M
              mrjeschke @Thomas Braun last edited by

              @thomas-braun
              Ja, Log wird erstellt.

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

                @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                Der Fixer ist jetzt auch unter Windows verfügbar! Wäre cool wenn ich da ggf auch Tester finden ...

                Also, wie schon im anderen Thread geschrieben, bekomme auch ich unter Windows den schon bekannten Fehler:

                F:\ioBrokerTest>npx @iobroker/fix
                Need to install the following packages:
                  @iobroker/fix@4.2.1
                Ok to proceed? (y) y
                "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                

                Wenn ich jetzt das Package nicht per npx ausführe, sondern installiere

                F:\ioBrokerTest>npm install @iobroker/fix
                

                Und dann das Script direkt starte:

                F:\ioBrokerTest>node node_modules\@iobroker\fix\lib-npx\install.js fix
                

                Läuft der Fixer erstmal los(!?), meldet am Ende aber einen Fehler:

                Windows installation starting... (fixing = true)
                NPM version: 8.19.3
                Write "iobroker start" to start the ioBroker
                npm install node-windows@1.0.0-beta.8 --force --loglevel error --production --save --prefix "F:/ioBrokerTest"
                
                up to date, audited 524 packages in 9s
                
                36 packages are looking for funding
                  run `npm fund` for details
                
                20 vulnerabilities (2 low, 16 moderate, 2 high)
                
                To address issues that do not require attention, run:
                  npm audit fix
                
                To address all issues (including breaking changes), run:
                  npm audit fix --force
                
                Run `npm audit` for details.
                
                =============================
                Running Admin shell
                =============================
                ioBroker wird beendet.
                ioBroker wurde erfolgreich beendet.
                
                ioBroker service is already installed.
                
                =============================
                Running Admin shell
                =============================
                ioBroker wird gestartet.
                ioBroker wurde erfolgreich gestartet.
                
                ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                NPM version: 8.19.3
                No path given, using F:\ioBrokerTest\iobroker-data
                Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                Cannot compress states.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\states.jsonl"!
                    at JsonlDB.open (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                    at async compressDB (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                    at async main (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:78:17)
                Compressing F:\ioBrokerTest\iobroker-data\objects.jsonl
                Cannot compress objects.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\objects.jsonl"!
                    at JsonlDB.open (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                    at async compressDB (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                    at async main (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:93:17)
                No relevant JSONL files found to compress, skip
                

                Hilft das irgendwie weiter?

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

                  @gaspode iobroker gestoppt vorher? Cannot lock db heißt das die dB offen ist. Fixer darf nur laufen wenn gestoppt ist.

                  Jetzt kapiere ich aber nicht warum es so „zu Fuß“ geht aber nicht direkt per npx. Das sollte genaueste gleiche tun 😞

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

                    @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                    iobroker gestoppt vorher?

                    Ja, ioBroker vorher mit iobroker stop gestoppt. Allerdings scheint er, wenn ich das Log richtig verstehe, unmittelbar vor der Komprimierung wieder gestartet zu werden (Zeile 29ff):

                    ...
                    =============================
                    Running Admin shell
                    =============================
                    ioBroker wird gestartet.
                    ioBroker wurde erfolgreich gestartet.
                    ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                    To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                    NPM version: 8.19.3
                    No path given, using F:\ioBrokerTest\iobroker-data
                    Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                    ...
                    

                    @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                    Jetzt kapiere ich aber nicht warum es so „zu Fuß“ geht aber nicht direkt per npx. Das sollte genaueste gleiche tun

                    Ich hatte das ja nur "zu Fuß" gemacht, weil ich hoffte, so die Stelle zu finden, wo etwas schief läuft. Hätte nicht erwartet, dass der Fixer dann startet.

                    Der npx Aufruf mit --verbose liefert übrigens das hier:

                    F:\ioBrokerTest>iobroker status
                    iobroker is not running on this host.
                    
                    Objects type: jsonl
                    States  type: jsonl
                    
                    F:\ioBrokerTest>npx --verbose @iobroker/fix
                    npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
                    npm info using npm@8.19.3
                    npm info using node@v16.19.0
                    npm timing npm:load:whichnode Completed in 0ms
                    npm timing config:load:defaults Completed in 2ms
                    npm timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 10ms
                    npm timing config:load:builtin Completed in 11ms
                    npm timing config:load:cli Completed in 2ms
                    npm timing config:load:env Completed in 1ms
                    npm timing config:load:file:F:\ioBrokerTest\.npmrc Completed in 1ms
                    npm timing config:load:project Completed in 3ms
                    npm timing config:load:file:C:\Users\OnkelAdmin\.npmrc Completed in 1ms
                    npm timing config:load:user Completed in 1ms
                    npm timing config:load:file:C:\Users\OnkelAdmin\AppData\Roaming\npm\etc\npmrc Completed in 0ms
                    npm timing config:load:global Completed in 0ms
                    npm timing config:load:validate Completed in 1ms
                    npm timing config:load:credentials Completed in 1ms
                    npm timing config:load:setEnvs Completed in 1ms
                    npm timing config:load Completed in 25ms
                    npm timing npm:load:configload Completed in 26ms
                    npm timing npm:load:mkdirpcache Completed in 1ms
                    npm timing npm:load:mkdirplogs Completed in 1ms
                    npm verb title npm exec @iobroker/fix
                    npm verb argv "exec" "--loglevel" "verbose" "--" "@iobroker/fix"
                    npm timing npm:load:setTitle Completed in 2ms
                    npm timing config:load:flatten Completed in 5ms
                    npm timing npm:load:display Completed in 20ms
                    npm verb logfile logs-max:10 dir:C:\Users\OnkelAdmin\AppData\Local\npm-cache\_logs
                    npm verb logfile C:\Users\OnkelAdmin\AppData\Local\npm-cache\_logs\2023-01-14T08_15_41_665Z-debug-0.log
                    npm timing npm:load:logFile Completed in 12ms
                    npm timing npm:load:timers Completed in 0ms
                    npm timing npm:load:configScope Completed in 0ms
                    npm timing npm:load Completed in 67ms
                    npm timing arborist:ctor Completed in 1ms
                    npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/iobroker.js-controller
                    "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                    npm timing command:exec Completed in 938ms
                    npm verb exit 255
                    npm timing npm Completed in 1307ms
                    npm verb code 255
                    

                    Hilf das evtl. weiter?

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

                      @gaspode ok das mit dem Start ist gut zu wissen. Dann schiebe ich den fixer weiter nach vorn im Code. Das logfile gibt sonst leider nix her was helfen würde außer das dieser Fehler vom exec des fix kommt. Aber waasrruuuuuuuuuuuummm 😞

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

                        @apollon77
                        Falls du vorab was zum lokal testen hast, kann ich das gerne erledigen.

                        Zeile 42 (kann das Zufall sein, 42? 😄 ) ist nicht verdächtig? Kommt jedes Mal.

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

                          @apollon77
                          Anbei meine Ergebnis (npm: 8.19.3), keine Probleme, Kompression erfolgreich:

                          olli@ioBroker:~$ iob stop
                          olli@ioBroker:~$ ls -la /opt/iobroker/iobroker-data/*.jsonl 
                          -rw-rw-r--+ 1 iobroker iobroker 27528654 Jan 14 09:12 /opt/iobroker/iobroker-data/objects.jsonl
                          -rw-rw-r--+ 1 iobroker iobroker 11819686 Jan 14 09:12 /opt/iobroker/iobroker-data/states.jsonl
                          olli@ioBroker:~$ curl -sLf https://raw.githubusercontent.com/ioBroker/ioBroker/dbcompress/fix_installation.sh | bash -
                          library: loaded
                          Library version=2022-12-09
                          
                          ==========================================================================
                          
                              Welcome to the ioBroker installation fixer!
                              Script version: 2022-11-19
                              
                              You might need to enter your password a couple of times.
                          
                          ==========================================================================
                          
                          
                          ==========================================================================
                              Installing prerequisites (1/4)
                          ==========================================================================
                          
                          [sudo] password for olli: 
                          Get:1 http://security.debian.org bullseye-security InRelease [48.4 kB]
                          Hit:2 http://ftp.debian.org/debian bullseye InRelease                                                                    
                          Get:3 http://ftp.debian.org/debian bullseye-updates InRelease [44.1 kB]                                                   
                          Hit:4 https://deb.nodesource.com/node_16.x bullseye InRelease                                  
                          Get:5 http://security.debian.org bullseye-security/main amd64 Packages [214 kB]
                          Get:6 http://security.debian.org bullseye-security/main Translation-en [139 kB]
                          Fetched 445 kB in 0s (1154 kB/s)                          
                          Reading package lists... Done
                          Installed gcc-c++
                          
                          ==========================================================================
                              Checking ioBroker user and directory permissions (2/4)
                          ==========================================================================
                          
                          Created /etc/sudoers.d/iobroker
                          Fixing directory permissions...
                          
                          ==========================================================================
                              Database maintenance (3/4)
                          ==========================================================================
                          
                          Checking for uncompressed JSONL databases... This might take a while!
                          
                          Compressing /opt/iobroker/iobroker-data/states.jsonl
                          Compressing /opt/iobroker/iobroker-data/objects.jsonl
                          Compressed 2 JSONL files. Done
                          
                          ==========================================================================
                              Checking autostart (4/4)
                          ==========================================================================
                          
                          Enabling autostart...
                          Autostart enabled!
                          
                          ==========================================================================
                          
                              Your installation was fixed successfully
                              Run iobroker start to start ioBroker again!
                          
                          ==========================================================================
                          
                          olli@ioBroker:~$ ls -la /opt/iobroker/iobroker-data/*.jsonl
                          -rw-rw-r--+ 1 iobroker iobroker 16939782 Jan 14 09:13 /opt/iobroker/iobroker-data/objects.jsonl
                          -rw-rw-r--+ 1 iobroker iobroker  2833129 Jan 14 09:13 /opt/iobroker/iobroker-data/states.jsonl
                          olli@ioBroker:~$
                          
                          1 Reply Last reply Reply Quote 0
                          • Gaspode
                            Gaspode last edited by Gaspode

                            @apollon77
                            Nochmal zu Windows:
                            Hab die Ursache gefunden, aber verstehen tu ich es nicht so richtig:
                            Der Fehler

                            "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                            

                            kommt aus dem Batch File iobroker.bat, das im ioBroker Verzeichnis liegt (ruft man iobroker.bat ohne Parameter auf, kommt genau dieser Fehler).
                            Aus irgendeinem Grund wird bei

                            npx @iobroker/fix
                            

                            iobroker.bat ausgeführt. Warum hab ich noch nicht rausbekommen.

                            Folgendes startet den Fixer auch unter Windows:

                            F:\ioBrokerTest>del iobroker.bat
                            
                            F:\ioBrokerTest>npx @iobroker/fix
                            
                            Windows installation starting... (fixing = true)
                            NPM version: 9.3.0
                            Write "iobroker start" to start the ioBroker
                            npm install node-windows@1.0.0-beta.8 --force --loglevel error --production --save --prefix "F:/ioBrokerTest"
                            
                            up to date, audited 524 packages in 6s
                            
                            36 packages are looking for funding
                              run `npm fund` for details
                            
                            20 vulnerabilities (15 moderate, 5 high)
                            
                            To address issues that do not require attention, run:
                              npm audit fix
                            
                            To address all issues (including breaking changes), run:
                              npm audit fix --force
                            
                            Run `npm audit` for details.
                            
                            =============================
                            Running Admin shell
                            =============================
                            ioBroker wird beendet.
                            ioBroker wurde erfolgreich beendet.
                            
                            ioBroker service is already installed.
                            
                            =============================
                            Running Admin shell
                            =============================
                            ioBroker wird gestartet.
                            ioBroker wurde erfolgreich gestartet.
                            
                            ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                            To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                            NPM version: 9.3.0
                            No path given, using F:\ioBrokerTest\iobroker-data
                            Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                            Cannot compress states.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\states.jsonl"!
                                at JsonlDB.open (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                at async compressDB (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                at async main (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:78:17)
                            Compressing F:\ioBrokerTest\iobroker-data\objects.jsonl
                            Cannot compress objects.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\objects.jsonl"!
                                at JsonlDB.open (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                at async compressDB (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                at async main (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:93:17)
                            No relevant JSONL files found to compress, skip
                            

                            Mit dem von oben bekanntem Problem, dass ioBroker vor der Komprimierung gestartet wird. Aber das weißt du ja schon.
                            Witzig: Der Fixer legt das gelöschte File iobroker.bat gleich wieder an, man macht sich durch das Löschen also nix kaputt. 😄

                            Edit: Für die Fehlermeldung in iobroker.bat und iob.bat hab ich PRs angelegt. Das hilft bei diesem Problem zwar nicht weiter, aber wenn man es schon mal weiß ...

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

                              neues Paket released ... jetzt ist der fixer weiter am Anfang vor dem Service kram

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

                                @apollon77

                                Ich hab jetzt auch versucht den Fixer unter Windows zu testen. Leider total ohne Erfolg 😞

                                Aber eins nach dem anderen:

                                System: Windows 10 22H2
                                Iobroker installiert via Installer 2022 unter c:\iobroker

                                Versuch unter normalem User:

                                C:\ioBroker>iobroker status
                                iobroker is not running on this host.
                                
                                
                                Objects type: jsonl
                                States  type: jsonl
                                
                                C:\ioBroker>iobroker fix
                                "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                
                                C:\ioBroker>
                                

                                Komisch ist, dass iobroker status deutlich dauert (10 Sekunden)

                                Dasselbe unter Admin (Eingabeaufforderung mit Admin Rechten gestartet)

                                C:\ioBroker>npx @iobroker/fix
                                "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                
                                C:\ioBroker>iobroker status
                                iobroker is not running on this host.
                                
                                
                                Objects type: jsonl
                                States  type: jsonl
                                
                                C:\ioBroker>npx @iobroker/fix
                                "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                
                                

                                Lösche ich nun iobroker.bat und versuche es mit dem normalen user nochmals kommt:

                                
                                C:\ioBroker>del iobroker.bat
                                
                                C:\ioBroker>npx @iobroker/fix
                                
                                [main 2023-01-14T20:19:09.893Z] update#setState idle
                                [main 2023-01-14T20:19:10.943Z] Starting extension host with pid 5872 (fork() took 11 ms).
                                [main 2023-01-14T20:19:18.994Z] Waiting for extension host with pid 5872 to exit.
                                [main 2023-01-14T20:19:19.014Z] Extension host with pid 5872 exited with code: 0, signal: null.
                                
                                C:\ioBroker>
                                

                                Wobei nach dem Aufruf visual studio code startet (!) und mir einen Source des js-controllers anzeigt !?!?
                                12886f1b-821b-4fc3-b347-b87bde941cad-image.png

                                Keine Ahnung warum das so ist und wo ich das ev. in Code abdrehen könnte.

                                mcm1957 2 Replies Last reply Reply Quote 0
                                • mcm1957
                                  mcm1957 @mcm1957 last edited by

                                  Bezüglich

                                  "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.

                                  hab ich eine Hypothese die ich aber nicht verifizieren konnte. In iobroker.bat steht

                                  @echo off
                                  if %1==fix (
                                      npx @iobroker/fix
                                  )
                                  

                                  Ih habe nun an einer STelle bei der Tante Google gefunden, dass es Programme gibt, die in einem Batch file das @ als Eingabeumleitung interpretieren und den Input dann vom angegebenen File lesen. Ich hab aber nix dazu gefunden, wie man das @ sicher escapen könnte und / oder ob das für npx überhaupt zutrifft. Versuche npx mit einem explizitem -p auftzurufen sind gescheitert - wahrscheinlich wegen mangeknder Kenntnis von npm bzw. der Info welche command das Package eigentlich erwartet.

                                  Link: https://stackoverflow.com/questions/21074863/what-is-the-at-sign-in-a-batch-file-and-what-does-it-do

                                  Not only does the "at" symbol placed in the beginning hide the command, it can, for some commands, also be used to append command arguments stored in a text file. The syntax is exe @commands.txt. armclang.exe for example supports this option.#```
                                  1 Reply Last reply Reply Quote 0
                                  • mcm1957
                                    mcm1957 @mcm1957 last edited by

                                    OK

                                    Den Extension Hist kann man da abdrehen:

                                    72ccd27c-d504-452c-9b99-e757688585fa-image.png

                                    mcm1957 1 Reply Last reply Reply Quote 0
                                    • mcm1957
                                      mcm1957 @mcm1957 last edited by

                                      @apollon77

                                      Soda - Ergebnisse mit abgeschaltetem VS Code Host:

                                      C:\ioBroker>iobroker status
                                      iobroker is running on this host.
                                      
                                      
                                      Objects type: jsonl
                                      States  type: jsonl
                                      
                                      C:\ioBroker>iobroker fix
                                      "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                      
                                      C:\ioBroker>npx @iobroker/fix
                                      "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                      
                                      C:\ioBroker>
                                      

                                      Lösche ich nun iobroker.bat so läuft der fixer durch. Leider wird am Ende der Screen gelöscht sodass man nur den nachfolgenden Screenshot sieht:

                                      63baa19d-a77d-4c05-b979-c874d81954b7-image.png

                                      mcm1957 1 Reply Last reply Reply Quote 0
                                      • mcm1957
                                        mcm1957 @mcm1957 last edited by mcm1957

                                        Was ich nun noch eingegrenzt habe:

                                        npx @iobroker/fix ruft das Script iobroker.bat nochmals ohne Paramater auf.
                                        Ich vermute mal, dass das daran liegt, dass @iobroker/fix bin:iobroker eingetragen hat und die Searchlist von npx das current working directory als erstes Verzeichnis einschließt.

                                        Wenn man ioBroker manuell ohne Paramter aufruft bekommt man denselben Fehler:

                                        C:\ioBroker>ioBroker
                                        ioBroker
                                        "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                        
                                        C:\ioBroker>
                                        

                                        OK

                                        Die Fehlermeldung kommt, da %1==fix ohne Parametereingabe ungültig wird ( ==fix ). Wenn man aber hier [%1]==[fix] schreibt ist zwar der cmd Fehler weg - dafür faäält das Script aber in die letzte Zeile durch und gibt nur den iobroker help text aus.

                                        Irgendwie muss "man" dem npx klar machen, dass es nicht iobroker im lokalen Verzeich nis ausführen soll sondern den Befehl im package ...

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

                                          @mcm57 Der change in den bar Files ist früher heute schon live gegangen im installer ... und @Gaspode hatte bereits rausgefunden das der Fehler wohl an der iobroker.bar liegt die - why ever - beim Ausführen des npm Befehls ausgeführt wird. Warum und wie man das umgeheen kann (oder die iobroker.bar anpassen das man sden Fall erkennt?) wäre der nächste Schritt

                                          mcm1957 1 Reply Last reply Reply Quote 1
                                          • mcm1957
                                            mcm1957 @apollon77 last edited by

                                            @apollon77

                                            Yep - das such ich ja.

                                            npx starte offensichtlich IMMER den Befehl der als erstes im PATH gefunden wird. Der ist hier iobroker. Wenn man im Package.json den Befehl nicht iobroker sondern z.B. iobroker-fix nennen würde, sollte es gehen. Ich weiß aber nicht wie ich das testen könnte.

                                            --ignore-existing bei npx hätte das auch lösen können:

                                            --ignore-existing - If this flag is set, npx will not look in $PATH, or in the current package's node_modules/.bin for an existing version before deciding whether to install. Binaries in those paths will still be available for execution, but will be shadowed by any packages requested by this install.
                                            

                                            Nur wurde der qualifier eleminiert 😞

                                            Hier gibts eine Erläuterung zu dem Problem:
                                            https://superuser.com/questions/1623020/npx-capacitor-cli-resolving-to-c-windows-rstcli-exe

                                            ERGO:
                                            Wenn es trivial möglich ist (ohne sideeffects) wäre es einen Versuch wert

                                              "main": "./lib-npx/install.js",
                                              "bin": {
                                                "iobroker": "./lib-npx/install.js"
                                              },
                                            

                                            durch z.B.

                                              "main": "./lib-npx/install.js",
                                              "bin": {
                                                "iobroker-fix": "./lib-npx/install.js"
                                              },
                                            

                                            oder iobroker-install ...

                                            zu ersetzen. Schätze nur, dass das Auswirkungen auf die normale Installation haben könnte falls der Command wo explizit verlangt wird. Wenn immer nur npx verwendet wird, sollte es egal sein da npx immer das erste command verwendet (wenn ich es richtig gelesen habe) und solange es nur eines gibt ...

                                            McM

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            770
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            15
                                            84
                                            5515
                                            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