Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Error: Cannot find module 'moment'

    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

    Error: Cannot find module 'moment'

    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lesiflo Most Active last edited by lesiflo

      Systemdata Bitte Ausfüllen
      Hardwaresystem: Pi4
      Arbeitsspeicher: 4GB
      Festplattenart: USB Stick
      Betriebssystem: Ubuntu
      Node-Version: 16.17.x
      Nodejs-Version: 16.17.x
      NPM-Version: 8.15.x
      Installationsart: Skript
      Image genutzt: Ja
      Ort/Name der Imagedatei: Link

      Hallo zusammen,
      ich wollte mir heute morgen den BLE Adapter installieren und hab auch noch ein Update des Admin Adapters gemacht. Jetzt startet iobroker nicht mehr, im syslog kommt ständig dieser Fehler hier:

      Sep 18 08:58:36 ioBroker-Pi systemd[1]: Started ioBroker Server.
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: Error initializing logger: Error: Cannot find module 'moment'
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: Require stack:
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/file-stream-rotator/FileStreamRotator.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/winston-daily-rotate-file/daily-rotate-file.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/winston-daily-rotate-file/index.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/@iobroker/js-controller-common/lib/common/logger.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/@iobroker/js-controller-common/index.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/@iobroker/js-controller-common-db/build/lib/common/tools.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/@iobroker/js-controller-common-db/build/index.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/iobroker.js-controller/main.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]: - /opt/iobroker/node_modules/iobroker.js-controller/controller.js
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Module.require (node:internal/modules/cjs/loader:1028:19)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at require (node:internal/modules/cjs/helpers:102:18)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Object.<anonymous> (/opt/iobroker/node_modules/file-stream-rotator/FileStreamRotator.js:15:14)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Module._compile (node:internal/modules/cjs/loader:1126:14)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Module.load (node:internal/modules/cjs/loader:1004:32)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
      Sep 18 08:58:38 ioBroker-Pi bash[11332]:     at Module.require (node:internal/modules/cjs/loader:1028:19)
      Sep 18 08:58:38 ioBroker-Pi systemd[1]: iobroker.service: Main process exited, code=exited, status=15/n/a
      Sep 18 08:58:38 ioBroker-Pi systemd[1]: iobroker.service: Failed with result 'exit-code'.
      

      Hab das schon versucht hier: sudo npm install moment
      Leider ohne Erfolg.

      Den "iobroker fix" habe ich auch schon lauafen lassen.

      Bei "iobroker logs --watch | uniq" kommt der gleiche Fehler wie oben: Uncaught Rejection: Error: Cannot find module 'moment'

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

        @lesiflo sagte in Error: Cannot find module 'moment':

        sudo npm install moment
        Leider ohne Erfolg.

        Kein Wunder. Macht man ja auch nicht so.

        iobroker stop
        iobroker fix
        iobroker status
        cd /opt/iobroker
        npm ls moment
        
        L 1 Reply Last reply Reply Quote 0
        • mickym
          mickym Most Active last edited by

          Das würde ich auch nicht machen. Wenn Du die moment Library in Deinen Blocklies oder JS verwenden willst, dann trag es in die JS Adapterkonfiguration ein und die Bibliothek installiert sich automatisch an der richtigen Stelle.

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

            @thomas-braun:

            Hi, hab ich gemacht. Kommt dann das hier:

            
            pi@ioBroker-Pi:/opt/iobroker $ iobroker status
            Server Configured backup period 120 is larger than the supported maximum of 35791 minutes. Defaulting to 120 minutes.
            iobroker is not running on this host.
            
            
            pi@ioBroker-Pi:/opt/iobroker $ npm ls moment
            iobroker.inst@2.0.3 /opt/iobroker
            ├─┬ iobroker.heatingcontrol@2.8.6
            │ └─┬ cron@1.8.2
            │   └─┬ moment-timezone@0.5.37
            │     └── moment@ deduped invalid: "^2.29.3" from node_modules/iobroker.iot, "^2.29.3" from node_modules/iobroker.synology, ">= 2.9.0" from node_modules/moment-timezone
            ├─┬ iobroker.iot@1.11.8
            │ └── moment@ invalid: "^2.29.3" from node_modules/iobroker.iot, "^2.29.3" from node_modules/iobroker.synology
            ├─┬ iobroker.js-controller@4.0.23
            │ └─┬ @iobroker/js-controller-common@4.0.23
            │   └─┬ winston-daily-rotate-file@4.7.1
            │     └─┬ file-stream-rotator@0.6.1
            │       └── moment@ deduped invalid: "^2.29.3" from node_modules/iobroker.iot, "^2.29.3" from node_modules/iobroker.synology, ">= 2.9.0" from node_modules/moment-timezone, "^2.29.1" from node_modules/file-stream-rotator
            └─┬ iobroker.synology@2.1.9
              └── moment@ deduped invalid: "^2.29.3" from node_modules/iobroker.iot, "^2.29.3" from node_modules/iobroker.synology
            
            npm ERR! code ELSPROBLEMS
            npm ERR! invalid: moment@ /opt/iobroker/node_modules/moment
            
            npm ERR! A complete log of this run can be found in:
            npm ERR!     /home/iobroker/.npm/_logs/2022-09-18T08_37_16_044Z-debug-0.log
            pi@ioBroker-Pi:/opt/iobroker $
            
            Thomas Braun 2 Replies Last reply Reply Quote 0
            • Thomas Braun
              Thomas Braun Most Active @lesiflo last edited by

              @lesiflo

              Bitte in CodeTags setzen. Oben auch.

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

                @lesiflo

                cd /opt/iobroker
                sudo -H -u iobroker npm install iobroker.js-controller
                
                L 1 Reply Last reply Reply Quote 0
                • L
                  lesiflo Most Active @Thomas Braun last edited by

                  @thomas-braun

                  pi@ioBroker-Pi:/opt/iobroker $ sudo -H -u iobroker npm install iobroker.js-controller
                  npm ERR! code ENOTEMPTY
                  npm ERR! syscall rename
                  npm ERR! path /opt/iobroker/node_modules/dropbox-v2-api
                  npm ERR! dest /opt/iobroker/node_modules/.dropbox-v2-api-TOHC73BD
                  npm ERR! errno -39
                  npm ERR! ENOTEMPTY: directory not empty, rename '/opt/iobroker/node_modules/dropbox-v2-api' -> '/opt/iobroker/node_modules/.dropbox-v2-api-TOHC73BD'
                  
                  npm ERR! A complete log of this run can be found in:
                  npm ERR!     /home/iobroker/.npm/_logs/2022-09-18T08_58_21_538Z-debug-0.log
                  
                  
                  Thomas Braun 1 Reply Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @lesiflo last edited by

                    @lesiflo

                    https://forum.iobroker.net/topic/57337/fehler-25-bei-adapter-install-update-mit-npm8

                    1 Reply Last reply Reply Quote 0
                    • L
                      lesiflo Most Active last edited by lesiflo

                      @thomas-braun

                      Läuft jetzt alles wieder. Vielen Dank für die Hilfe. 👍

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

                        @lesiflo

                        iobroker status
                        systemctl status iobroker
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        664
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        3
                        10
                        605
                        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