GuilhermeC18 / node-onvif

The node-onvif is a Node.js module which allows you to communicate with the network camera which supports the ONVIF specifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not start server.js, SyntaxError: Unexpected token >

StefanRu1 opened this issue · comments

node ./server.js

/home/pi/node_modules/node-onvif/sample/manager/server.js:118
onvif.startDiscovery((device) => {
^
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

node -v
v0.10.29

npm -v
1.4.21

Thank you,
Stefan

It does not work on node v.0.10.29. Use node v.4.4+.

hi same problem using node -v = v8.8.1

Thank you for your feedback.
Can you tell me the error in detail? The message "SyntaxError: Unexpected token" should not be output on node v8. What did the error says on your console?

TypeError: Cannot read property 'prototype' of undefined
at Object. (/Users/shamrymubdi/node-onvif/node_modules/websocket.io/lib/socket.js:49:43)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object. (/Users/shamrymubdi/node-onvif/node_modules/websocket.io/lib/protocols/drafts.js:12:14)
at Module._compile (module.js:643:30)

manage to run on node@4

Thank you for the details. The node module websocket.io possibly does not support node v8.
I'll set up an environment of node v8 and try the server.js.