adriana
Hi Marco,
I see the log file and there are no errors, the Lightstreamer is starting correctly.
This is the error message that the Node Adapter is giving to me when I call this command $ node adapters.js:
C:\Lightstreamer\adapters\NodeAdapter\lib\adapters.js:6
reqRespStream = net.createConnection(8001, localhost),
^
ReferenceError: localhost is not defined
at Object.<anonymous> (C:\Lightstreamer\adapters\NodeAdapter\lib\adapters.js:6:44)
at Module._compile (module.js:456:26)
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:901:3
marco.testa
Hi Adriana,
actually, if it's a literal string, you should write the address between quotes: so "localhost" instead of localhost, otherwise it is interpreted as a variable.
adriana
Thanks Marco, it passed but now it's giving me another error
module.js:340
throw err;
^
Error: Cannot find module 'lightstreamer-adapter'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Lightstreamer\adapters\NodeAdapter\lib\adapters.js:11:24)
at Module._compile (module.js:456:26)
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)
what I suppose do to?
I've installed Node.js manually, not by running these command npm install lightstreamer-adapter, because it gives me the following error:
/cygdrive/c/Program Files/nodejs/npm: line 2: $'\r': command not found
/cygdrive/c/Program Files/nodejs/npm: line 4: $'\r': command not found
/cygdrive/c/Program Files/nodejs/npm: line 5: syntax error near unexpected token `$'in\r''
'cygdrive/c/Program Files/nodejs/npm: line 5: `case `uname` in
marco.testa
Hi Adriana,
if you have installed the windows version of node.js, try to run 'npm install lightstreamer-adapter' from a windows command instead of from a cygwin shell.
adriana
Hey Marco you were right, the installation passed that way, but running node adapters.js gives the same error... :/
Any idea what should I do?
marco.testa
if the error is still "Error: Cannot find module 'lightstreamer-adapter'", it means it is not able to properly install the adapter.
try to uninstall the adapter, clear the cache and reinstall it.
npm uninstall lightstreamer-adapter
npm cache clean
npm install lightstreamer-adapter
hth
adriana
Thanks Marco, it helps, but now I have another error
dataProvider.update(itemName, false, {
^
ReferenceError: itemName is not defined
at Object.<anonymous> (C:\Lightstreamer\sdk_adapter_node_1.0.0_build_3\lib\node_modules\lightstreamer-adapter\lib\adapters.js:33:21)
at Module._compile (module.js:456:26)
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:901:3
for what stands itemName, what is for?
tnx
marco.testa
As before itemName should be a literal string, so somethink like "MyItemName", or a variable: in this case you should have done before something like:
var itenName = "MyItemName"
adriana
You were right :Smile_Ab:
Could you tell me what are these fields for
'field1': valField1,
'field2': valField2 ?
adriana
You were right :Smile_Ab:
But now it says fields are not defined.
'field1': valField1, 'field2': valField2
for what are these?
marco.testa
Hi Adriana
a good point to start is
Lightstreamer General Concepts
You'll find a good introduction on the general concepts behind Lightstreamer. It will clarify many of your doubts.
adriana
thanks again Marco :Smile_Ab: