Closed Yakwrangler closed 5 years ago
Hi, which version of node do you use? Have you installed git?
Currently only Node 8 is supported. I'll try to add support for newer node versions this weekend if I have time.
GIT already installed version 1:2.11.0-3+deb9u4
Node v10.15.3 ... so that would probably explain it then.
Appreciate it if you could add support for later versions over the weekend ... thanks.
Sure,
can you please try to replace the version in package.json
with henry-spanka#master
and run npm install
Edit: as you haven't installed it yet, add the following to your package.json
and run npm install
{
"dependencies": {
"node-red-contrib-hikvision": "henry-spanka#master"
}
}
Ah ... missed the edit so installed original as follows;
~/.node-red/node_modules/node-red-contrib-hikvision $ npm install package.json npm notice created a lockfile as package-lock.json. You should commit this file.
How would you like me to proceed?
Hi, that's not quite right ;)
Please stop Node-Red first and then remove the plugin:
rm -r ~/.node-red/node_modules/node-red-contrib-hikvision
Edit ~/.node-red/package.json and add the dependency to the list:
nano ~/.node-red/package.json
It should look like this:
{
"name": "node-red-project",
"description": "A Node-RED Project",
"version": "0.0.1",
"dependencies": {
"crc": "^3.8.0",
"node-red-contrib-configurable-interval": "~0.9.1",
"node-red-contrib-fs-ops": "~1.5.0",
"node-red-contrib-graphite": "~1.0.0",
"node-red-contrib-hikvision": "henry-spanka#master", // <--- add this
"node-red-contrib-i2c": "henry-spanka/node-red-contrib-i2c#master",
"node-red-contrib-simple-message-queue": "~0.2.5"
}
}
You only need to add the "node-red-contrib-hikvision" dependency. I just left the other things in there for demo purposes. Your own plugins should appear there.
Run npm install
cd ~/.node-red/ && npm install
Start Node-Red.
Thanks for the hand-holding ;) npm install gave following error ...
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name "henry-spanka#master": Tags may not have any characters that encodeURIComponent encodes.
Sry, my bad.
try henry-spanka/node-red-contrib-hikvision#master
No problem ... now produces following ...
npm ERR! code EJSONPARSE npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected token , in JSON at position 251 while parsing near '...ib-hikvision#master", npm ERR! JSON.parse "node-red-cont...' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
Can you post your package.json please?
Of course ... { "name": "node-red-project", "description": "A Node-RED Project", "version": "0.0.1", "dependencies": { "node-red-contrib-file-buffer": "0.0.3", "node-red-contrib-fs-ops": "~1.5.0", "henry-spanka/node-red-contrib-hikvision#master", "node-red-contrib-ibm-watson-iot": "^0.2.8", "node-red-contrib-image-output": "^0.4.0", "node-red-contrib-jsonpath": "~0.1.1", "node-red-contrib-moment": "~3.0.2", "node-red-contrib-openalpr-cloud": "0.0.1", "node-red-contrib-play-audio": "^2.3.2", "node-red-contrib-simpletime": "~2.4.0", "node-red-contrib-ui-led": "~0.2.3", "node-red-contrib-uppercase": "0.0.3", "node-red-dashboard": "^2.14.0", "node-red-node-base64": "^0.1.3", "node-red-node-ping": "0.0.16", "node-red-node-pisrf": "~0.1.4", "node-red-node-random": "^0.1.2", "node-red-node-serialport": "^0.8.1", "node-red-node-smooth": "^0.1.0" } }
Try this:
{
"name": "node-red-project",
"description": "A Node-RED Project",
"version": "0.0.1",
"dependencies": {
"node-red-contrib-file-buffer": "0.0.3",
"node-red-contrib-fs-ops": "~1.5.0",
"node-red-contrib-hikvision": "henry-spanka/node-red-contrib-hikvision#master",
"node-red-contrib-ibm-watson-iot": "^0.2.8",
"node-red-contrib-image-output": "^0.4.0",
"node-red-contrib-jsonpath": "~0.1.1",
"node-red-contrib-moment": "~3.0.2",
"node-red-contrib-openalpr-cloud": "0.0.1",
"node-red-contrib-play-audio": "^2.3.2",
"node-red-contrib-simpletime": "~2.4.0",
"node-red-contrib-ui-led": "~0.2.3",
"node-red-contrib-uppercase": "0.0.3",
"node-red-dashboard": "^2.14.0",
"node-red-node-base64": "^0.1.3",
"node-red-node-ping": "0.0.16",
"node-red-node-pisrf": "~0.1.4",
"node-red-node-random": "^0.1.2",
"node-red-node-serialport": "^0.8.1",
"node-red-node-smooth": "^0.1.0"
}
}
Success! ... node-red-contrib-hikvision installed with 4 modules ... I'll now go and play with these.
Thanks for your support, much appreciated
Great!
Attempting to install from Node Red on RasPi produces the following missing file error.
My finger trouble or issue?
Thanks
2019-06-12T09:27:55.287Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-hikvision@1.0.0 2019-06-12T09:28:14.589Z [err] npm 2019-06-12T09:28:14.589Z [err] ERR! path git 2019-06-12T09:28:14.589Z [err] npm ERR! code ENOENT 2019-06-12T09:28:14.589Z [err] npm 2019-06-12T09:28:14.590Z [err] ERR! errno ENOENT 2019-06-12T09:28:14.590Z [err] npm ERR! syscall spawn git 2019-06-12T09:28:14.593Z [err] npm 2019-06-12T09:28:14.594Z [err] ERR! enoent Error while executing: 2019-06-12T09:28:14.594Z [err] npm ERR! enoent 2019-06-12T09:28:14.594Z [err] undefined ls-remote -h -t ssh://git@github.com/nayrnet/node-hikvision-api.git 2019-06-12T09:28:14.594Z [err] npm ERR! 2019-06-12T09:28:14.594Z [err] enoent 2019-06-12T09:28:14.594Z [err] npm ERR! 2019-06-12T09:28:14.594Z [err] enoent 2019-06-12T09:28:14.594Z [err] npm 2019-06-12T09:28:14.594Z [err] ERR! enoent spawn git ENOENT 2019-06-12T09:28:14.595Z [err] npm 2019-06-12T09:28:14.595Z [err] ERR! enoent This is related to npm not being able to find a file. 2019-06-12T09:28:14.595Z [err] npm 2019-06-12T09:28:14.595Z [err] ERR! enoent