Hi Miles,
Can you provide step by step procedures, to get it working? because it is still throwing error.
Blockquote
[13:48:08] root@smarthome:/etc/openhab2/scripts/tuyapi# cd njsTuya/
[13:48:16] root@smarthome:/etc/openhab2/scripts/tuyapi/njsTuya# node njysTuya.js
module.js:549
throw err;
^
Error: Cannot find module ‘/etc/openhab2/scripts/tuyapi/njsTuya/njysTuya.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:188:16)
at bootstrap_node.js:609:3
[13:48:39] root@smarthome:/etc/openhab2/scripts/tuyapi/njsTuya# npm init
(node:16765) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sane defaults.
See npm help json
for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> --save
afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (njsTuya)
version: (0.0.0)
description:
entry point: (index.js)
test command:
git repository: (GitHub - unparagoned/njsTuya: Openhab interface for Tuya home automation devices sold under various names)
keywords:
author:
license: (ISC)
About to write to /etc/openhab2/scripts/tuyapi/njsTuya/package.json:
{
“name”: “njsTuya”,
“version”: “0.0.0”,
“description”: “Copies of config files are in .config”,
“main”: “index.js”,
“scripts”: {
“test”: “echo "Error: no test specified" && exit 1”
},
“repository”: {
“type”: “git”,
“url”: “git+https://github.com/unparagoned/njsTuya.git”
},
“author”: “”,
“license”: “ISC”,
“bugs”: {
“url”: “Issues · unparagoned/njsTuya · GitHub”
},
“homepage”: “GitHub - unparagoned/njsTuya: Openhab interface for Tuya home automation devices sold under various names”
}
Is this ok? (yes) yes
[13:49:44] root@smarthome:/etc/openhab2/scripts/tuyapi/njsTuya# npm install njsTuya
(node:16799) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN install Refusing to install njsTuya as a dependency of itself
[13:49:58] root@smarthome:/etc/openhab2/scripts/tuyapi/njsTuya# node njstuya.js
module.js:549
throw err;
^
Error: Cannot find module ‘/etc/openhab2/scripts/tuyapi/njsTuya/njstuya.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:188:16)
at bootstrap_node.js:609:3
[13:50:17] root@smarthome:/etc/openhab2/scripts/tuyapi/njsTuya#
Blockquote