TheThingsArchive / integration-azure

Microsoft Azure IoT Hub Integration for TTN Applications
MIT License
9 stars 10 forks source link

ttn.Client is not a constructor #18

Closed lukaswerz closed 6 years ago

lukaswerz commented 7 years ago

Hi!

Thank you for this package, its exactly what I want to do. But I can not run the script... It fails inside the package script. I use Windows 10 Enterprise, 64bit, node -v = v8.5.0

The PowerShell Log is this:

D:\Projekte\bla\bla\Source\iot_server\node_modules\ttn-azure-iothub\index.js:32
this.ttnClient = new ttn.Client(region, appId, accessKey);
^
TypeError: ttn.Client is not a constructor
at new Bridge (D:\Projekte\bla\bla\Source\iot_server\node_modules\ttn-azure-iothub\index.js:32:22)
at Object. (D:\Projekte\bla\bla\Source\iot_server\server.js:15:16)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:201:16)
at bootstrap_node.js:626:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iot_server@1.0.0 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iot_server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\lukas\AppData\Roaming\npm-cache_logs\2017-09-14T12_37_32_150Z-debug.log PS D:\Projekte\bla\bla\Source\iot_server>

The Log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@5.3.0
3 info using node@v8.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle iot_server@1.0.0prestart: iot_server@1.0.0
6 info lifecycle iot_server@1.0.0start: iot_server@1.0.0
7 verbose lifecycle iot_server@1.0.0start: unsafe-perm in lifecycle true
8 verbose lifecycle iot_server@1.0.0start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\Projekte\bla\bla\Source\iot_server\node_modules.bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Java\jdk1.8.0_101\bin;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\systools;C:\WINDOWS\CCM;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Git\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MongoDB\Server\3.4\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Skype\Phone;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Users\lukas\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\lukas\AppData\Roaming\npm
9 verbose lifecycle iot_server@1.0.0start: CWD: D:\Projekte\bla\bla\Source\iot_server
10 silly lifecycle iot_server@1.0.0start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle iot_server@1.0.0start: Returned: code: 1 signal: null
12 info lifecycle iot_server@1.0.0start: Failed to exec start script
13 verbose stack Error: iot_server@1.0.0 start: node server.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at ChildProcess.emit (events.js:213:7)
13 verbose stack at maybeClose (internal/child_process.js:927:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid iot_server@1.0.0
15 verbose cwd D:\Projekte\bla\bla\Source\iot_server
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v8.5.0
19 verbose npm v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error iot_server@1.0.0 start: node server.js
22 error Exit status 1
23 error Failed at the iot_server@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Any help would be great. Thanks! Lukas

johanstokking commented 7 years ago

@lukaswerz thanks for reporting. We broke this package by an update indeed, and we're not maintaining this version anymore. There will be an awesome Azure integration available soon.

lukaswerz commented 7 years ago

Hi @johanstokking Thank you for your answer! Did you just changed npm azure-integration package or did you make changes on the server side too? I'm not a npm expert, but if you only changed code inside the module, its may possible to use an older version of the package. What do you think?

Anyway I'm looking forward for your new AWS integration. Thank you, Lukas

johanstokking commented 7 years ago

@lukaswerz yes, the Azure integration should use an older version which is still published.