[Solved] "Spark is not defined" - NodeJS Simple issue?

Hi Spark community, I’m having some issues connecting to my spark core from my pc. I’ve included a screenshot showing the issue I’m having. I’m running some javascript from the command line, which I thought would list the devices I have registered to my pc, but I get the error message “spark is not defined”.

The javascript I am using is from the “Spark Docs | Javascript SDK” page. I have installed nodejs and sparkjs. Am I making some kind of basic error?

Any help anyone could give me would be appreciated!

I can’t see where you “create” the spark object/instance.

The docs show doing that this way

var spark = require('spark');
1 Like

Thanks scruffR! That worked!

I really appreciate your help, even if it was a basic error like that!

1 Like

No problem :smile:

Basic problems have the advantage that I can solve them :wink:

1 Like