Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. [gelöst] npm registry umstellen

    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

    [gelöst] npm registry umstellen

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

      @AlCalzone

      Ich habe jetzt die Typdefinitionen in der package.json meines Moduls angegeben und

      e00e1349-daa4-4640-be5a-f67f048849fd-grafik.png

      aber damit wird doch jetzt noch nicht eine neue Version des Moduls aus dem npm-repository gezogen, oder?

      Mir ist noch nicht ganz klar, wo ich sehe, dass das Modul erfolgreich geladen wurde.
      Oder muss ich es doch in der package.json selber eintragen?

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

        @smartmeta Updates macht der JS-Adapter nicht. Das musst du dann wohl manuell updaten:

        cd /opt/iobroker/node_modules/iobroker.javascript
        npm i oho-iobroker-tools@latest
        

        oder (@ver.si.on)

        Dann Adapter neu starten.

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

          Hi @AlCalzone,

          okay

          npm i oho-iobroker-tools@latest
          

          und Adapter neu starten habe ich gemacht. Leider keine Verbesserung.

          Ich habe den Adapter jetzt mal mit Chrome remote gedebuggt.
          Die Types werden auch laut log richtig geladen

          2020-07-02 15:27:56.404  - debug: javascript.0 (9826) Loaded TypeScript definitions for node: ["@types/node/index.d.ts","@types/node/base.d.ts","@types/node/globals.global.d.ts","@types/node/assert.d.ts","@types/node/globals.d.ts","@types/node/async_hooks.d.ts","@types/node/buffer.d.ts","@types/node/child_process.d.ts","@types/node/cluster.d.ts","@types/node/console.d.ts","@types/node/constants.d.ts","@types/node/crypto.d.ts","@types/node/dgram.d.ts","@types/node/dns.d.ts","@types/node/domain.d.ts","@types/node/events.d.ts","@types/node/fs.d.ts","@types/node/http.d.ts","@types/node/http2.d.ts","@types/node/https.d.ts","@types/node/inspector.d.ts","@types/node/module.d.ts","@types/node/net.d.ts","@types/node/os.d.ts","@types/node/path.d.ts","@types/node/perf_hooks.d.ts","@types/node/process.d.ts","@types/node/punycode.d.ts","@types/node/querystring.d.ts","@types/node/readline.d.ts","@types/node/repl.d.ts","@types/node/stream.d.ts","@types/node/string_decoder.d.ts","@types/node/timers.d.ts","@types/node/tls.d.ts","@types/node/trace_events.d.ts","@types/node/tty.d.ts","@types/node/url.d.ts","@types/node/util.d.ts","@types/node/v8.d.ts","@types/node/vm.d.ts","@types/node/worker_threads.d.ts","@types/node/zlib.d.ts"]
          2020-07-02 15:29:06.080  - debug: javascript.0 (9826) Loaded TypeScript definitions for request: []
          2020-07-02 15:30:22.450  - debug: javascript.0 (9826) Loaded TypeScript definitions for oho-iobroker-tools: ["@types/oho-iobroker-tools/lib/index.d.ts"]
          2020-07-02 15:31:05.172  - info: javascript.0 (9826) requesting all states
          

          Trotzdem kann ich das Modul nicht in den Scripten nutzen:
          a81ade0f-02f9-4aa8-afc4-02df019fa2d5-grafik.png

          Das Modul habe ich auch schon auf das nötigste reduziert um Fehler auszuschliessen (naja die test.js könnte ich auch noch löschen):
          d56eda23-274a-4050-8d1f-96d641fbd9ff-grafik.png

          Zusätzlich habe ich noch mal ein neues Node-Projekt erstellt, in dem genau der Code (wie im Script) verwendet wird:

          import {A} from 'oho-iobroker-tools';
          
          const a = new A();
          console.log (a.add(1,2));
          
          

          Da klappt das wunderbar.


          Wo muss ich den Breakpoint setzen,
          damit ich mit

          iobroker stop iobroker.javascript
          >The adapter "javascript.0" was stopped.
          
          node --inspect-brk=0.0.0.0:9229 node_modules/iobroker.javascript/main.js --debug
          

          das Ausführen meine Sciptes MODULEX im Javascript-Adapter debuggen kann?

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

            @smartmeta das @types vor dem modulnamen erscheint mir in deinem Fall falsch. Dein Modul bringt ja die Typen mit. Müsste ich mir mal anschauen. Gibt es das auf npm?

            smartmeta 1 Reply Last reply Reply Quote 0
            • smartmeta
              smartmeta @AlCalzone last edited by

              @AlCalzone

              Nein, das gibt es nicht auf NPM. Ich habe leider nicht genug Zeit um ein Modul auf NPM dauerhaft zu betreuen.

              Habs dir hier mal angehangen:

              oho-iobroker-tools-1.0.4.tgz

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

                @smartmeta Fix ist hier:
                https://github.com/ioBroker/ioBroker.javascript/pull/610

                Du kannst ihn testen, indem du den Adapter von der URL https://github.com/AlCalzone/ioBroker.javascript/tarball/types-resolve-fixes installierst.

                AlCalzone created this issue in ioBroker/ioBroker.javascript

                closed Fixes for type definition resolution #610

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

                  @AlCalzone sagte in npm registry umstellen:

                  https://github.com/AlCalzone/ioBroker.javascript/tarball/types-resolve-fixes

                  Hi @AlCalzone,
                  vielen Dank schon mal für den PR. Sehr cool, dass du mir hilfst.

                  Ich habe

                   "iobroker.javascript": "https://github.com/AlCalzone/ioBroker.javascript/tarball/types-resolve-fixes",
                  

                  in die package.json eingetragen und

                  sudo -u iobroker  npm i
                  

                  aufgerufen. Bekomme nun

                  ╭─────────────────────────────────────────────────────────╮
                  │                                                         │
                  │ Manual installation of ioBroker is no longer supported  │
                  │ on Linux, OSX and FreeBSD!                              │
                  │ Please refer to the documentation on how to install it! │
                  │ https://github.com/ioBroker/ioBroker/wiki/Installation  │
                  │                                                         │
                  ╰─────────────────────────────────────────────────────────╯
                  

                  Wie ist denn der vorgesehene Weg für das manuelle Nachinstallieren von Adaptern?

                  Denn in der Doku habe ich leider auch nichts dazu gefunden.
                  4e4a8878-44a7-4d11-94e1-b4af5b0d1b25-grafik.png

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

                    @smartmeta package.json solltest du nur im absoluten Notfall bearbeiten, z.B. um eine kaputte Datei zu korrigieren.

                    Du suchst das hier: https://www.iobroker.net/#de/documentation/tutorial/adapter.md, was übrigens der 1. Link in dem von dir gefundenen Artikel war 🙈

                    Entweder du installierst den Adapter direkt per npm:

                    cd /opt/iobroker
                    npm i https://github.com/AlCalzone/ioBroker.javascript/tarball/types-resolve-fixes
                    

                    Benutzerwechsel ist hier nicht nötig, das passiert automatisch.

                    Oder (bevorzugt) über den Admin:
                    4fde7d6d-1c66-4a2c-9eac-4b8fbc84fc46-grafik.png

                    smartmeta 1 Reply Last reply Reply Quote 0
                    • smartmeta
                      smartmeta @AlCalzone last edited by smartmeta

                      @AlCalzone

                      der erste Link in dem von mir gefunden Dokument (Update eines Adapters) ist leider nicht verlinkt.
                      😉

                      Aber der Link https://www.iobroker.net/#de/documentation/tutorial/adapter.md ist gut. Danke!

                      Installation über
                      f5a8e982-20b8-4b78-8f3d-4c43f9c69feb-grafik.png
                      probiere ich später aus.

                      Danke

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

                        @AlCalzone
                        Okay, eingetragen und der Adapter ist neu geladen.

                        Zur Sicherheit auch noch mal nachgesehen, dass deine Änderung in

                        /lib/typescriptTools.js 
                        

                        auch drin ist. Alles okay.

                        Dann zur Sicherheit noch mal

                        iobroker stop
                        iobroker start
                        

                        Leider funktioniert das TS-Modul noch immer nicht.
                        7dac6abb-2fef-4fb6-8e59-336d3e4907c3-grafik.png

                        Ich versuche das am Wochenende mal zu debuggen.

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

                          Hi @AlCalzone,

                          da mein Typescript ModulX bei mir noch immer nicht läuft, bin ich noch mal einen Schritt zurück gegangen.

                          Ich versuche jetzt das Modul oho-iobroker-tools in einer reinen Javascript Umgebung.

                          Zuerst ein Test in PHPStorm ganz ohne iobroker:
                          7ded8cc1-e0fd-4e7b-80d2-a79d01738516-grafik.png

                          Nun den gleichen Code

                          var oho_iobroker_tools_1 = require("oho-iobroker-tools");
                          var a = new oho_iobroker_tools_1.A();
                          console.log(a.add(1, 20));
                          

                          im Javascript-Adapter :
                          2e64eb45-1c04-4d4a-b3ab-2138de4b8155-grafik.png

                          Wie auch in der Typescript-Variante wird die Klasse A nicht gefunden.
                          751e3eea-dbd5-40d5-8cb2-26f931635e66-grafik.png

                          Kannst du noch mal bitte schauen, ob das bei dir klappt. Vielleicht mache ich ja nur etwas ganz banales falsch.

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

                            @smartmeta Installier bitte nochmal die neueste Version aus dem Branch:

                            8228dc7d-57dd-4a2d-8c49-c54be86d0906-grafik.png

                            1 Reply Last reply Reply Quote 1
                            • smartmeta
                              smartmeta last edited by

                              @AlCalzone

                              vielen Dank, sehr cool.
                              Mit deinem Branch funktioniert es jetzt sowohl im Javascript als auch im Typescript.

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

                                @AlCalzone

                                Nur aus Neugier: Wann kommen die Änderungen in den Master?

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

                                  @smartmeta Der PR ist jetzt germerged. Wann released wird, ist in Klärung.

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

                                    @AlCalzone okay, danke.

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

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate

                                    641
                                    Online

                                    31.7k
                                    Users

                                    79.9k
                                    Topics

                                    1.3m
                                    Posts

                                    javaskript adapter nexus npm registry
                                    2
                                    22
                                    1091
                                    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