I'm new to Webpack, Visual Studio, and Task Runner, but these are what I have been told to install/use at work so I'm struggling through figuring out how to make it all work. I just used NPM to globally install a fresh copy of webpack and webpack-cli. I installed the Task Runner plugin to Visual Studio, and used the Run > Development option as provided. Mysteriously, mine is the only machine getting the following error and no one knows why:
C:\Users\[me]\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:3
let webpackCliInstalled = false;
^^^
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:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:429:10)
at startup (node.js:139:18)
at node.js:999:3
Process terminated with code 1.
I'm using the newest version of NodeJS and NPM. Any ideas why an unmodified download of webpack would be throwing block-scope errors?
Edit:
I see this question has got some attention so I thought I should mention that the problem was resolved. Unfortunately, the resolution was to completely uninstall webpack and webpack-cli and reinstall them. Then it just worked. Why...? Who knows? I have heard others have had this problem as well, though I haven't reproduced it since the first time.
let
,const
and the like, you need a transpiler, like babel. Please provide some information on if you have got a webpack config and I'll be glad to help out. – Honduras