HIKVISION Probleme dépendance nodejs

Bonjour
Petit souci sur mes dépendances que je n’arrive pas à lancer…
La version nodejs semble pas bonne. je suis bien en Debian 10 mise à jour.
Je ne comprends pas non plus l’interaction avec le plugin #plugin-wifilightv2 de @bernardfr.caron .
Etrange.
Il semble avoir supprimé nodejs 14.18.2 pour le réinstaller…

Les voici

Début de l'installation
--2021-12-31 00:17:05--  https://raw.githubusercontent.com/lunarok/jeedom_nodejs/master/nodejs.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1552 (1.5K) [text/plain]
Saving to: 'dependencies.sh'
0K .                                                     100% 22.2M=0s
2021-12-31 00:17:05 (22.2 MB/s) - 'dependencies.sh' saved [1552/1552]
dependencies.sh: 3: [: /tmp/jeedom/hikvision/dependance: unexpected operator
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon3008.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon1519.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon1210.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon1102.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon1212.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2223.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2100.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/wifilightV2_icon.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon1504.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2219.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2602.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2302.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images/icon2415.png': Operation not permitted
chown: changing ownership of '/var/www/html/plugins/wifilightV2/data/images': Operation not permitted
Version actuelle : 14
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://ftp.fr.debian.org/debian buster InRelease
Hit:3 http://ftp.fr.debian.org/debian buster-updates InRelease
Hit:4 http://phoscon.de/apt/deconz buster InRelease
Hit:5 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
lsb-release is already the newest version (10.2019051400).
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
dependencies.sh: 29: dependencies.sh: [[: not found
KO, version obsolète à upgrader
Suppression du Nodejs existant et installation du paquet recommandé
Reading package lists...
Building dependency tree...
Reading state information...
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
nodejs*
0 upgraded, 0 newly installed, 1 to remove and 13 not upgraded.
After this operation, 122 MB disk space will be freed.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 71468 files and directories currently installed.)
Removing nodejs (14.18.2-deb-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
dependencies.sh: 38: [: x86_64: unexpected operator
Utilisation du dépot officiel
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://ftp.fr.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Hit:3 http://ftp.fr.debian.org/debian buster-updates InRelease
Hit:4 http://phoscon.de/apt/deconz buster InRelease
Hit:5 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
## Confirming "buster" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Hit:1 http://ftp.fr.debian.org/debian buster InRelease
Hit:2 http://ftp.fr.debian.org/debian buster-updates InRelease
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Hit:4 http://phoscon.de/apt/deconz buster InRelease
Hit:5 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
nodejs
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 0 B/25.1 MB of archives.
After this operation, 122 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 66536 files and directories currently installed.)
Preparing to unpack .../nodejs_14.18.2-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.18.2-deb-1nodesource1) ...
Setting up nodejs (14.18.2-deb-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
ln: failed to create symbolic link '/usr/bin/nodejs': File exists
Version actuelle : v14.18.2
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://github.com/Tsopic/hikvision-node-eventSubscribe.git /root/.npm/_cacache/tmp/git-clone-a7b5122e/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-a7b5122e/.git'
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-30T23_17_16_774Z-debug.log
chown: cannot access 'node_modules': No such file or directory
Fin de l'installation

Tu es en beta du plugin wifilightV2.
Ce dernier met un chattr sur les fichiers du dossier où se passe l’erreur afin d’empêcher l’effacement des fichiers par quiconque. J’ai posé la question dans la partie développeur sur les effets de bord de cette commande.
Le script que tu utilises change le propriétaire, je pense, de tout le dossier /html et ce qu’il y a dessous (c’est pour moi un peu bizarre de faire cela).
Comme il y a un chattr, cette commande est interdite même à un sudoer linux.
Maintenant cela ne devrait avoir aucune incidence sur le fonctionnement d’un script qui installe les dépendances d’un autre plugin.
Sauf si chown s’arrête sur sa récursivité s’il voit une erreur mais je serais étonné car il devrait s’arrêter à la première erreur détectée.

Pour supprimer le chattr :

  • désactive le plugin (son deamon met chattr dedans)
  • applique la commande suivante :
sudo chattr -i -R /var/www/html/plugins/wifilightV2/data/images

et recommence l’installation des dépendances.
WifilightV2 ne désinstalle ni n’installe nodejs

ok on en discute ailleur. mais sinon ce problème n’est pas ce qui bloque ici.

Merci @nebz
J’ai un accès interdit (privé) ou la page n’existe pas sur ta discussion scindée pour la modification des fichiers.
Normal ?

Oui c’est dans la partie developeur. Mais comme j’ai dit plus haut c’est pas la raison de ton problème, juste un message en passant

sinon tu eux repasser en beta du plugin. Les messages d’erreur n’apparaitront plus.
et dis moi ce que tu peux tester sur Tuya,Exwelink/sonoff,nanoleaf,Govee.
Les images personnelles seront déplacées dans data/myImages, ce sera de même en stable.

J’ai repassé en stable avec ta modif qui a réglé le problème.
Pour l’instant je n’ai qu’un device tuya que tu connais :slight_smile: Je te l’indiquerai sur un autre post le cas échéant pour ne pas poluer celui-là qui concerne le problème de dépendances du plugin hik.

Bonjour,

Il s’agit d’un problème de droits d’accès en écriture sur /root/.npm/_cacache/tmp/
pour le compte exécutant git.

tu peux essayer :
sudo chown -R root:root /root/.npm

akenad :slight_smile:

1 « J'aime »

Bien vu :wink: Merci

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.