Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. __dirname ist not defined

    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

    __dirname ist not defined

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

      Hallo Forum,

      ich versuche den aktuellen Pfad mittels

      const path = require('path');
      console.log("Current directory:"+ __dirname); 
      

      auszulesen, doch ich bekomme immer den Fehler

      javascript.0	2020-05-31 21:19:50.582	error	(456) at Script.runInContext (vm.js:133:20)
      javascript.0	2020-05-31 21:19:50.582	error	(456) at script.js.pathdirname:2:35
      javascript.0	2020-05-31 21:19:50.582	error	(456) ReferenceError: __dirname is not defined
      javascript.0	2020-05-31 21:19:50.582	error	(456) ^
      javascript.0	2020-05-31 21:19:50.582	error	(456) console.log("Current directory:"+ __dirname);
      javascript.0	2020-05-31 21:19:50.581	error	(456) script.js.pathdirname: script.js.pathdirname:2
      

      Kann mir mal jemand auf die Sprünge helfen.

      Gruß

      Dolomiti

      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

      859
      Online

      31.9k
      Users

      80.3k
      Topics

      1.3m
      Posts

      javascript
      1
      1
      278
      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