JavaScript Node.js Basics Building a Command Line Application Getting the Response Body

error in the program

when i run the program name app.js i found an error. error is:

    kaustabh@kaustabh-Inspiron-5567:~/Learn$ node app1.js

/home/kaustabh/Learn/app1.js:18 let body = ""; ^^^

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 Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3

1 Answer

can u add a snapshot? it’s hard to know what’s wrong like that