JeeWeetje / ttn-azure-workshop

The Things Network - Azure IoT workshop
MIT License
2 stars 5 forks source link

ttn.Client is not a constructor #12

Open lukaswerz opened 6 years ago

lukaswerz commented 6 years ago

Hi!

Thank you for this tutorial, its exactly what I want to do. Actually I fail on point "Start the bridge"

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.0~prestart: iot_server@1.0.0 6 info lifecycle iot_server@1.0.0~start: iot_server@1.0.0 7 verbose lifecycle iot_server@1.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle iot_server@1.0.0~start: 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.0~start: CWD: D:\Projekte\bla\bla\Source\iot_server 10 silly lifecycle iot_server@1.0.0~start: Args: [ '/d /s /c', 'node server.js' ] 11 silly lifecycle iot_server@1.0.0~start: Returned: code: 1 signal: null 12 info lifecycle iot_server@1.0.0~start: 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 6 years ago

@JeeWeetje we have updated the ttn node package

JeeWeetje commented 6 years ago

I will have a look at it, after my return from Codecamp in Romania. Doing the workshop there with @sandervandevelde again.

johanstokking commented 6 years ago

@JeeWeetje @sandervandevelde curious to how it went and to which extent this issue is relevant still.

JeeWeetje commented 6 years ago

Codecamp was a bliss. 34 attendees doing the workshop and about 100-125 attendees watched our presentation (doing the workshop on stage in 45m with live coding/demos). Got good feedback and showed them the TTN Romania community. We had several people asking how to get started themselves.

So if the number of gateways spike in the Iasi area, we did well. ;-)

About the issue, it might still be relevant, since we have the NodeJS bridge (optional path) still in our workshop. I schedule time for looking into this tomorrow.

HannahJury commented 5 years ago

I am having the same problem. Has this issue been fixed?

zhaozhenhong5 commented 5 years ago

Yes, I have the same issue, "npm start" failed. See the log below: ################### 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.6.0 3 info using node@v8.11.2 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle techdays42@1.0.0~prestart: techdays42@1.0.0 6 info lifecycle techdays42@1.0.0~start: techdays42@1.0.0 7 verbose lifecycle techdays42@1.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle techdays42@1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\techdays42\node_modules.bin;C:\Program Files\VanDyke Software\Clients\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Calibre2\;C:\Users\Windows7.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\HashiCorp\Vagrant\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\dotnet\;C:\Users\Windows7\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\Windows7\AppData\Local\Programs\Python\Python36-32\;C:\Users\Windows7\AppData\Roaming\npm;C:\Users\Windows7\AppData\Local\Yarn\bin;C:\Users\Windows7\AppData\Local\GitHubDesktop\bin;C:\Users\Windows7\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Windows7.dotnet\tools;C:\Program Files\Docker Toolbox 9 verbose lifecycle techdays42@1.0.0~start: CWD: C:\techdays42 10 silly lifecycle techdays42@1.0.0~start: Args: [ '/d /s /c', 'node server.js' ] 11 silly lifecycle techdays42@1.0.0~start: Returned: code: 1 signal: null 12 info lifecycle techdays42@1.0.0~start: Failed to exec start script 13 verbose stack Error: techdays42@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\node_modules\npm-lifecycle\index.js:285:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:925:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid techdays42@1.0.0 15 verbose cwd C:\techdays42 16 verbose Windows_NT 6.1.7601 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.11.2 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 1 22 error techdays42@1.0.0 start: node server.js 22 error Exit status 1 23 error Failed at the techdays42@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 ]