bash-3.2$ node start.js/Users/lixiangyong/Desktop/廖雪峰nodejs/view-koa/app.js:33 let staticFiles = require('./static-files'); ^^^
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 loader (/Users/lixiangyong/Desktop/廖雪峰nodejs/view-koa/node_modules/babel-core/node_modules/babel- register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/lixiangyong/Desktop/廖雪峰nodejs/vie
前面章节阅读不仔细,node所有程序都要按node --use_strict app.js启动
node --use_strict app.js
Sign in to make a reply
度_Li
bash-3.2$ node start.js
/Users/lixiangyong/Desktop/廖雪峰nodejs/view-koa/app.js:33
let staticFiles = require('./static-files');
^^^
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 loader (/Users/lixiangyong/Desktop/廖雪峰nodejs/view-koa/node_modules/babel-core/node_modules/babel- register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/lixiangyong/Desktop/廖雪峰nodejs/vie