NEWS
[gelöst] npm lässt sich nicht installieren/ fehlt
-
Hallo!
npm bekomme ich nicht installiert, ggf in diesem Zusammenhang lassen sich über iobroker die Adapter nicht updaten.
Hatte eine 2.xx Version vom admin und habe gestern die auf die neueste Version über die Oberfläche von iobroker geupdatet. Um diese zu updaten war wohl eine höhere Version von node bzw nodejs erforderlich.
Aktuell
nodejs -v 6.14.3
node -v 4.2.1
System…cubietruck 3 mit HDD und ARMBIAN Debian GNU/Linux 8 (jessie) 4.7.3-sunxi
folgender Fehler:
root@cubietruck:~# npm i -g npm
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# npm i -g npm
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# sudo npm install iobroker.js-controller --production
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# npm -v
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# npm install npm@latest -g
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# sudo apt-get install -y nodejs
Reading package lists... 0%
Reading package lists... 100%
Reading package lists... Done
Building dependency tree... 0%
Building dependency tree... 0%
Building dependency tree... 50%
Building dependency tree... 50%
Building dependency tree... 69%
Building dependency tree... 98%
Building dependency tree
Reading state information... 0%
Reading state information... 0%
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@cubietruck:~# node -v
v4.2.1
root@cubietruck:~# nodejs -v
v6.14.3
root@cubietruck:~# npm -v
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~#
Wie bekomme ich das wieder zum laufen?
Da ich mich für den enocean Adapter interessiere, bräuchte ich wohl nodejs 7.xx oder höher.
Bin leider nicht so bewandert mit Linux....hoffe auf hilfe.
LG
Chris
-
nodejs -v 6.14.3
node -v 4.2.1 `
Es sind zwei Versionen von nodejs installiert.
@blackangel15741:root@cubietruck:~# npm -v
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82 `
npm scheint defekt zu sein.Was ergibt ?
ls -l /usr/local/bin/node* ls -l /usr/local/bin/np* ls -l /usr/bin/node* ls -l /usr/bin/np* /usr/bin/npm -v
-
Hatte inzwischen probiert aber noch keine Lösung gefunden.
ARMBIAN 5.38 stable Debian GNU/Linux 8 (jessie) 4.7.3-sunxi
root@cubietruck:~# npm -v
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
root@cubietruck:~# nodejs -v
v8.11.3
root@cubietruck:~# ls -l /usr/local/bin/node*
-rwxr-xr-x 1 root staff 11949036 Okt 17 2015 /usr/local/bin/node
root@cubietruck:~# ls -l /usr/local/bin/np*
lrwxrwxrwx 1 root root 38 Jul 17 22:28 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 root root 38 Jul 17 22:28 /usr/local/bin/npx -> ../lib/node_modules/npm/bin/npx-cli.js
root@cubietruck:~# ls -l /usr/bin/node*
-rwxr-xr-x 1 root root 24793548 Jun 13 02:28 /usr/bin/node
lrwxrwxrwx 1 root root 24 Jan 29 17:15 /usr/bin/nodejs -> /etc/alternatives/nodejs
root@cubietruck:~# ls -l /usr/bin/np*
lrwxrwxrwx 1 root root 38 Jun 13 02:27 /usr/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
-rwxr-xr-x 1 root root 18088 Mär 14 2015 /usr/bin/nproc
lrwxrwxrwx 1 root root 38 Jun 13 02:27 /usr/bin/npx -> ../lib/node_modules/npm/bin/npx-cli.js
root@cubietruck:~# /usr/bin/npm -v
ERROR: npm is known not to run on Node.js v4.2.1
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/
root@cubietruck:~#
-
root@cubietruck:~# ls -l /usr/local/bin/node*
-rwxr-xr-x 1 root staff 11949036 Okt 17 2015 /usr/local/bin/node `
Welche Version hat node ?/usr/local/bin/node -v /usr/bin/node -v
Bitte die Terminal-Ausgaben in Code tags posten !
-
Wie geht das mit
Code tags?
-
root@cubietruck:~# /usr/local/bin/node -v
v4.2.1
root@cubietruck:~# /usr/bin/node -v
v8.11.3
Ist das Problem die Version 4.2.1 local/bin ?
Oder das es node 2xgibt?
Es steht oben, dass npm nicht unter 4.2.1 läuft.
Ist da der Fehler? Hatte vorher auch auf 6 geupdatet und irgendwo stand, dass mit der v6xx npm zerschossen wird.
-
root@cubietruck:~# /usr/local/bin/node -v
v4.2.1 `
Das habe ich vermutet. Lösche einfach die alte Datei.rm /usr/local/bin/node /usr/bin/npm -v
Wie geht das mit
Code tags? ` Auf den Button oben klicken und an der Cursorposition den Text einfügen.
-
root@cubietruck:~# rm /usr/local/bin/node /usr/bin/npm -v removed ‘/usr/local/bin/node’ removed ‘/usr/bin/npm’ root@cubietruck:~# node -v v8.11.3 root@cubietruck:~# nodejs -v v8.11.3 root@cubietruck:~# npm -v 6.2.0 root@cubietruck:~#
-
Du solltest eigentlich /usr/bin/npm nicht löschen, sondern die Version abfragen. Deshalb wundert mich jetzt die Ausgabe von
@blackangel15741:root@cubietruck:~# npm -v 6.2.0 ```` `
Wenn npm jetzt in der Version 6.2.0 gemeldet wird, sollte alles in Ordnung sein ?
-
Nun lässt sich iobroker nicht mehr starten
Error: Cannot find module '/opt/iobroker/node_modules/iobro er.js-controller/iobroker.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3 root@cubietruck:~#
-
root@cubietruck:~# npm -v 6.2.0 root@cubietruck:~# nodejs -v v8.11.3 root@cubietruck:~# npm -v 6.2.0 root@cubietruck:~# iobroker start module.js:549 throw err; ^ Error: Cannot find module '/opt/iobroker/node_modules/iobro er.js-controller/iobroker.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3 root@cubietruck:~# ps -A | grep iobroker root@cubietruck:~# cd /opt/iobroker root@cubietruck:/opt/iobroker# iobroker stop module.js:549 throw err; ^ Error: Cannot find module '/opt/iobroker/node_modules/iobro er.js-controller/iobroker.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3 root@cubietruck:/opt/iobroker# npm install iobroker.js-cont oller > iobroker.js-controller@1.4.2 preinstall /opt/iobroker/nod _modules/iobroker.js-controller > node lib/preinstall_check.js NPM version: 6.2.0 npm version >= 5: disabling package-lock > unix-dgram@0.2.3 install /opt/iobroker/node_modules/unix- gram > node-gyp rebuild make: Entering directory '/opt/iobroker/node_modules/unix-d ram/build' CXX(target) Release/obj.target/unix_dgram/src/unix_dgram. SOLINK_MODULE(target) Release/obj.target/unix_dgram.node COPY Release/unix_dgram.node make: Leaving directory '/opt/iobroker/node_modules/unix-dg am/build' > iobroker.js-controller@1.4.2 install /opt/iobroker/node_m dules/iobroker.js-controller > node iobroker.js setup first npm WARN winston-daily-rotate-file@1.7.2 requires a peer of winston@2.x but none is installed. You must install peer de endencies yourself. + iobroker.js-controller@1.4.2 added 297 packages from 187 contributors and audited 921 pa kages in 158.266s found 15 vulnerabilities (9 low, 3 moderate, 3 high) run `npm audit fix` to fix them, or `npm audit` for detai s root@cubietruck:/opt/iobroker# iobroker start Starting iobroker controller daemon... /opt/iobroker/node_modules/daemonize2/lib/daemonize.js:136 throw new Error(msg.error); ^ Error: TypeError: Cannot set property DailyRotateFile of #< bject> which has only a getter at Object. <anonymous>(/opt/iobroker/node_modules/winst n-daily-rotate-file/index.js:184:36) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. <anonymous>(/opt/iobroker/node_modules/iobro er.js-controller/lib/logger.js:7:23) at Module._compile (module.js:652:30) at ChildProcess. <anonymous>(/opt/iobroker/node_modules daemonize2/lib/daemonize.js:136:19) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js 141:11) at process._tickCallback (internal/process/next_tick.js 180:9) root@cubietruck:/opt/iobroker# iobroker start Starting iobroker controller daemon... /opt/iobroker/node_modules/daemonize2/lib/daemonize.js:136 throw new Error(msg.error); ^ Error: TypeError: Cannot set property DailyRotateFile of #< bject> which has only a getter at Object. <anonymous>(/opt/iobroker/node_modules/winst n-daily-rotate-file/index.js:184:36) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. <anonymous>(/opt/iobroker/node_modules/iobro er.js-controller/lib/logger.js:7:23) at Module._compile (module.js:652:30) at ChildProcess. <anonymous>(/opt/iobroker/node_modules daemonize2/lib/daemonize.js:136:19) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js 141:11) at process._tickCallback (internal/process/next_tick.js 180:9) root@cubietruck:/opt/iobroker#</anonymous></anonymous></anonymous></anonymous></anonymous></anonymous>
-
root@cubietruck:/opt/iobroker# iobroker start Starting iobroker controller daemon... /opt/iobroker/node_modules/daemonize2/lib/daemonize.js:136 throw new Error(msg.error); ^ Error: TypeError: Cannot set property DailyRotateFile of #< bject> which has only a getter at Object. <anonymous>(/opt/iobroker/node_modules/winst n-daily-rotate-file/index.js:184:36) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. <anonymous>(/opt/iobroker/node_modules/iobro er.js-controller/lib/logger.js:7:23) at Module._compile (module.js:652:30) at ChildProcess. <anonymous>(/opt/iobroker/node_modules daemonize2/lib/daemonize.js:136:19) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at emit (internal/child_process.js:772:12) at _combinedTickCallback (internal/process/next_tick.js 141:11) at process._tickCallback (internal/process/next_tick.js 180:9) root@cubietruck:/opt/iobroker#</anonymous></anonymous></anonymous>
-
Dazu, dass sich ioBroker nicht starten lässt, passt die Überschrift nicht. Für dieses Problem mache besser ein neues Thema auf. Dann werden Dir Nutzer helfen, die sich mit dem Problem besser auskennen als ich.
-
Ich danke für die Hilfe!
-
removed ‘/usr/bin/npm’ ```` `
Das sollte eigentlich nicht sein. Wird die Version geliefert ?
/usr/bin/npm -v
Wenn nicht, dann kopiere npm vom Verzeichnis /usr/local/bin, denn es ist ein Symlink mit einer relativen Pfadangabe.
cp /usr/local/bin/npm /usr/bin/ npm -v
-
Hallo, habe mal ne Frage….
Mein System läuft auf einem Tinkerboard. Benutze dazu das SD-Image Tinkerboard Homematic All-In-One mit piVCCU -nodejs 6.12.0
Ich wollte den neuen ( ham ) Adapter ausprobieren und hab im entsprechenden Forum gelesen, dass nodejs min 8 benötigt wird...
Jetzt zu meiner Frage...
Bei der Versionsabfrage ist mit aufgefallen, dass ich eine node und node.js instanz laufen habe... Ist das jetzt normal oder ein Problem?
Ich muss dazu sagen, dass mein S'ystem stabil läuft ohne Probleme.
Durch diesen Threat hier bin ich etwas verunsichert...
Node hat sich ohne Probleme updaten lasse auf ne 10 er Version...
Wie mache ich ein update für node.js?
-
dass ich eine node und node.js instanz laufen habe… Ist das jetzt normal oder ein Problem? `
es ist normal, wenn die beide die selbe Version haben. Dann ist es höchstwahrscheinlich, dass die beiden Abfragen die gleiche Installation (ggf. via Symlink) abfragen.Sollten es aber verschiedene Versionen sein, hast du definitiv zwei Installationen drauf und das IST ein Problem.
Wie mache ich ein update für node.js? `
gemäß obigem: Was gibt das jetzt aus?Node hat sich ohne Probleme updaten lasse auf ne 10 er Version… `
10 ist aber noch auf eigene Gefahr!Gruß
Rainer
-
Danke für die antwort, dann habe ich jetzt wohl ein Problem, da beide versionen unterschiedlich sind…nodejs ist noch die 6er Version....
Kannst du mir sagen wie ich das wieder hingebogen bekomme?
Wie kann ich beides auf die 8er Version bringen? Oder lieber wieder mein SD Backup einspielen und das iobroker Backup laden...