我收到此错误:
意外的严格模式保留字
当我尝试运行此代码时:
"use strict";
var
fs = require('fs'),
spawn = require('child_process').spawn,
filename = process.argv[2];
if(!filename){
throw Error('A File to watch must be specified!');
}
fs.watch(filename,function(){
let ls = spawn('ls',['-lh',filename]);
ls.stdout.pipe(process.stdout);
});
console.log("now watching " + filename + " for changes.....");