Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,140 Views

edison sample examples fails with ReferenceError: Map is not defined

Hi,

I am an IoT and Node newbie so apologize if it's mere ignorance.

I am trying to connect Intel edison to AWS IoT and trying to run the same app to verify the messages published by light sensor.

However I am getting the following error :

root@kedison:~/aws-iot-device-sdk-js# node edison-basic.js

/home/root/aws-iot-device-sdk-js/device/index.js:232

var activeSubscriptions = new Map();

^

ReferenceError: Map is not defined

at new DeviceClient (/home/root/aws-iot-device-sdk-js/device/index.js:232:34)

at Function.DeviceClient (/home/root/aws-iot-device-sdk-js/device/index.js:164:14)

at new ThingShadowsClient (/home/root/aws-iot-device-sdk-js/thing/index.js:123:32)

at ThingShadowsClient (/home/root/aws-iot-device-sdk-js/thing/index.js:89:14)

at update_state (/home/root/aws-iot-device-sdk-js/edison-basic.js:81:24)

at Object. (/home/root/aws-iot-device-sdk-js/edison-basic.js:75:1)

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)

I have tried both npm install as well as git clone as per - https://github.com/aws/aws-iot-device-sdk-js GitHub - aws/aws-iot-device-sdk-js: SDK for connecting to AWS IoT from a device using JavaScript/Node.js

I tried the suggestions as per this thread -

Have all packages and dependencies installed. Looks to me like a code issue and any help that you could provide would be greatly appreciated.

Thanks.

3 Replies
Highlighted
Employee
19 Views

Hello cloud-junkie,

I installed AWS as explained in https://github.com/aws/aws-iot-device-sdk-js SDK for connecting to AWS IoT from a device using JavaScript/Node.js and once it finished I was going to try to test edison-basic.js just like you did but I could not find this example. Where did you get it?

Since I couldn't find the example I did a quick search to see if I was missing something and I found https://github.com/intel-iot-devkit/aws-iot-intel AWS' Getting Started with Edison, have you tried to install AWS like stated in that guide? In case you haven't I'd suggest you to try it since it is Edison specific unlike the link you posted above that is general for JavaScript.

Let me know if this helps.

Peter.

0 Kudos
Highlighted
Beginner
19 Views

Running into the same issue. I can run the same node.js code on my laptop but it fails on the Edison. I also I have tried both npm install as well as git clone. Could it be a version issue? I wll do some research at

http://nodejs.org/ http://nodejs.org/

0 Kudos
Highlighted
Beginner
19 Views

So upgraded node.js and now its working. See instructions below

0 Kudos