Friday, 25 August 2017

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

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:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/srinivasnidadavolu/Downloads/testapp/app.js:42:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)

    at node.js:974:3



solution:
Declare strict mode at the beginning of the function or constant to use Block-scoped declarations.

"use strict"



Related Posts:

  • 1st WebServer with node.js In this article, i will create 1st Web Server. STEPS: Listen port Receive Request send response loading static files Http Module: include http module var http=require("http"); create a server var server=http.createS… Read More
  • Node.js Introduction!-- google_ad_client = "ca-pub-4378340310740210"; /* rectangle-nodemongo */ google_ad_slot = "1751391070"; google_ad_width = 336; google_ad_height = 280; //-- Node is a platform for writing server side javascriptapp… Read More
  • Filesystem module (fs) in node.js !-- google_ad_client = "ca-pub-4378340310740210"; /* node */ google_ad_slot = "4782569475"; google_ad_width = 728; google_ad_height = 90; //-- File system module is to access files on the disk. To use the module, use&n… Read More
  • NPM!-- google_ad_client = "ca-pub-4378340310740210"; /* rectangle-nodemongo */ google_ad_slot = "1751391070"; google_ad_width = 336; google_ad_height = 280; //-- What is NPM? NPM stands for Node Package Manager. Whne we inst… Read More
  • Event mechanism in node.js !-- google_ad_client = "ca-pub-4378340310740210"; /* node */ google_ad_slot = "4782569475"; google_ad_width = 728; google_ad_height = 90; //-- Node.js is an Event driven like Dom. When user interacts with particular inte… Read More

0 comments:

Post a Comment