NEWS
Node und/oder ioB Experte gesucht
-
Führe den folgenden Befehl aus:
npm config set global falseDann noch mal mit dem Befehl von vorhin kontrollieren.
Und jetzt einen Adapter installieren und das .bin suchen. ;-)
-
OK - habe ich gemacht - sieht jetzt so aus.
C:\WINDOWS\system32>npm config set global false C:\WINDOWS\system32>npm config ls -g ; cli configs global = true metrics-registry = "https://registry.npmjs.org/" scope = "" user-agent = "npm/6.4.1 node/v8.13.0 win32 ia32" ; userconfig C:\Users\SmartHome\.npmrc msvs_version = "2017" python = "python2.7" ; builtin config undefined prefix = "C:\\Users\\SmartHome\\AppData\\Roaming\\npm" ; node bin location = C:\Program Files\nodejs\node.exe ; cwd = C:\WINDOWS\system32 ; HOME = C:\Users\SmartHome ; "npm config ls -l" to show all defaults.Nach der Installation ist im Hauptverzeichnis nur diese Datei neu erzeugt worden - .npmrc - aber vielleicht gehört die ja sowieso da hin. Habe ich vielleicht immer zuviel gelöscht.
Im regulären *.bin Ordner hat sich an den Dateien nichts geändert (Zeitstempel ist immer noch vom Tag der ersten Installation)
…. aber es sind auch keine neuen Dateien im Hauptverzeichnis abgelegt worden. Der Adapter ist auch regulär im node_modules Ordner angelegt worden.
..... allerdings wurden beim LÖSCHEN des Adapters die *.bin Dateien wieder im Hauptverzeichnis erzeugt.
-
Das global in Deiner Config ist immer noch true. Schau mal, wie du das auf false (ist default so) bringst.
-
ich habe nochmal ins Log geschaut - da bekomme ich diesen Einträge während des löschens.
host.iobroker 2018-12-29 12:28:23.253 error Cannot write files: C:/ioBroker/node_modules/iobroker.js-controller/lib/objects/../../../../iobroker-data/files/mqtt.admin/_data.json: ENOENT: no such file or directory, open 'C:\ioBroker\iobroker-da iobroker 2018-12-29 12:28:23.034 info npm uninstall iobroker.mqtt --silent --save --prefix "C:/ioBroker" (System call) iobroker 2018-12-29 12:28:22.238 info host.iobroker Deleting 1 state(s). iobroker 2018-12-29 12:28:22.238 info host.iobroker Deleting 2 object(s). iobroker 2018-12-29 12:28:22.238 info host.iobroker Counted 1 states (system.adapter.mqtt.*) from states iobroker 2018-12-29 12:28:22.222 info host.iobroker Counted 1 states of mqtt iobroker 2018-12-29 12:28:21.988 info host.iobroker Counted 1 adapters for mqtt iobroker 2018-12-29 12:28:21.972 info host.iobroker no instances of adapter mqtt found iobroker 2018-12-29 12:28:21.956 info Delete adapter "mqtt" iobroker 2018-12-29 12:28:21.550 info del mqtt -
Das global in Deiner Config ist immer noch true. Schau mal, wie du das auf false (ist default so) bringst. `
Könnte in irgendeiner .npmrc-Datei stehen…
-
Habe beim googeln das hier gefunden - beschreibt ziehmlich genau auch mein Problem
Kann ich den Befehl auch verwenden oder zerschieße ich mir dann ggf. etwas?
> I was having a weird issue where things that would usually end up in node_modules/bin were ending up in my project root directory. A simple ****npm config delete prefix**** fixed this for me, thanks! (no idea where the prefix came from)Ich habe nur diese eine npmrc Datei gefunden und da steht lediglich drin:
package-lock=false -
So, habe mich an den Rechner gesetzt und geschaut.
npm config ls -lmüsste unter anderem die folgenden Zeilen ausgeben, oder?
global = false global-style = false globalconfig = "C:\\Users\\<username>\\AppData\\Roaming\\npm\\etc\\npmrc" globalignorefile = "C:\\Users\\<username>\\AppData\\Roaming\\npm\\etc\\npmignore"</username></username>Bei der Installation von iobroker-Adaptern steht doch bei Dir auch in etwa das Folgende?
npm install ...... --prefix "C:/ioBroker" -
Das kommt dabei raus
! C:\WINDOWS\system32>npm config ls -l
! ; cli configs
! long = true
! metrics-registry = "https://registry.npmjs.org/"
! scope = ""
! user-agent = "npm/6.4.1 node/v8.13.0 win32 ia32"
! ; userconfig C:\Users\SmartHome.npmrc
! global = false
! msvs_version = "2017"
! python = "python2.7"
! ; builtin config undefined
! prefix = "C:\Users\SmartHome\AppData\Roaming\npm"
! ; default values
! access = null
! allow-same-version = false
! also = null
! always-auth = false
! audit = true
! audit-level = "low"
! auth-type = "legacy"
! bin-links = true
! browser = null
! ca = null
! cache = "C:\Users\SmartHome\AppData\Roaming\npm-cache"
! cache-lock-retries = 10
! cache-lock-stale = 60000
! cache-lock-wait = 10000
! cache-max = null
! cache-min = 10
! cafile = undefined
! cert = null
! cidr = null
! color = true
! commit-hooks = true
! depth = null
! description = true
! dev = false
! dry-run = false
! editor = "notepad.exe"
! engine-strict = false
! fetch-retries = 2
! fetch-retry-factor = 10
! fetch-retry-maxtimeout = 60000
! fetch-retry-mintimeout = 10000
! force = false
! git = "git"
! git-tag-version = true
! <size size="150">global = false
! global-style = false
! globalconfig = "C:\Users\SmartHome\AppData\Roaming\npm\etc\npmrc"
! globalignorefile = "C:\Users\SmartHome\AppData\Roaming\npm\etc\npmignore"</size>
! group = 0
! ham-it-up = false
! heading = "npm"
! https-proxy = null
! if-present = false
! ignore-prepublish = false
! ignore-scripts = false
! init-author-email = ""
! init-author-name = ""
! init-author-url = ""
! init-license = "ISC"
! init-module = "C:\Users\SmartHome\.npm-init.js"
! init-version = "1.0.0"
! json = false
! key = null
! legacy-bundling = false
! link = false
! local-address = undefined
! loglevel = "notice"
! logs-max = 10
! ; long = false (overridden)
! maxsockets = 50
! message = "%s"
! ; metrics-registry = null (overridden)
! node-options = null
! node-version = "8.13.0"
! noproxy = null
! offline = false
! onload-script = null
! only = null
! optional = true
! otp = null
! package-lock = true
! package-lock-only = false
! parseable = false
! prefer-offline = false
! prefer-online = false
! ; prefix = "C:\Program Files\nodejs" (overridden)
! preid = ""
! production = false
! progress = true
! proxy = null
! read-only = false
! rebuild-bundle = true
! registry = "https://registry.npmjs.org/"
! rollback = true
! save = true
! save-bundle = false
! save-dev = false
! save-exact = false
! save-optional = false
! save-prefix = "^"
! save-prod = false
! scope = ""
! script-shell = null
! scripts-prepend-node-path = "warn-only"
! searchexclude = null
! searchlimit = 20
! searchopts = ""
! searchstaleness = 900
! send-metrics = false
! shell = "C:\WINDOWS\system32\cmd.exe"
! shrinkwrap = true
! sign-git-commit = false
! sign-git-tag = false
! sso-poll-frequency = 500
! sso-type = "oauth"
! strict-ssl = true
! tag = "latest"
! tag-version-prefix = "v"
! timing = false
! tmp = "C:\Users\SMARTH~1\AppData\Local\Temp"
! umask = 0
! unicode = false
! unsafe-perm = true
! update-notifier = true
! usage = false
! user = 0
! ; user-agent = "npm/{npm-version} node/{node-version} {platform} {arch}" (overridden)
! userconfig = "C:\Users\SmartHome\.npmrc"
! version = false
! versions = false
! viewer = "browser"….. und das kommt bei npm install..... --prefix raus
C:\WINDOWS\system32>npm install ...... --prefix npm WARN invalid config prefix=true npm WARN invalid config Must be a valid filesystem path npm ERR! code ENOLOCAL npm ERR! Could not install from "......" as it does not contain a package.json file. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\SmartHome\AppData\Roaming\npm-cache\_logs\2018-12-29T13_00_44_292Z-debug.log -
Klar, dass bei dem Befehl ein Fehler kommt. Der prefix-Parameter erwartet einen Pfad. Und der wird, was ich Dir zeigen wollte, bei einer Adapterinstallation auf c:\iobroker bei Dir gesetzt. Was auch in Ordnung ist.
Wen global aktiv ist, dann wird auch dort der .bin-Ordner abgelegt. Wenn nicht, dann im node_modules. Bei Dir ist default-global aus. Was auch richtig ist.
Mehr weiß ich leider nicht.
-
Schade - trotzdem Danke das du dir die Zeit genommen hast.