ryanmurakami / pizza-luvrs

❤️🍕🍕❤️ Demo project for AWS Developer: Getting Started on Pluralsight
114 stars 255 forks source link

imageStoreS3.js requires 'use strict' to work #11

Closed sgrade closed 4 years ago

sgrade commented 7 years ago

Dear Ryan,

In module 5 "Hosting All the Things with S3" clip "Connecting to S3 with Code" file imageStoreS3.js causes an error - see below. In my case it was fixed by adding 'use strict' to the top of the file.

roman@ubuntu:~/Devel/pizza-luvrs$ nodejs index.js /home/roman/Devel/pizza-luvrs/lib/imageStoreS3.js:5 let params = { ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/home/roman/Devel/pizza-luvrs/lib/imageStore.js:4:13) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10)

ryanmurakami commented 7 years ago

Hi @sgrade, thanks for the comment! That is true for Node.js versions < 6. What version were you using? If you upgrade past v6, you should see that error go away without needing 'use strict';

You can check your Node.js version by running the command node -v.