2
votes

I have tried to create a project using

$ vue init webpack test

and got following error

/usr/local/lib/node_modules/vue-cli/bin/vue-init:60 let template = program.args[0] ^ 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

Unfortunatly, "test" directory is not created.

I am using Bash on Ubuntu on Windows 10 and the following NPM packages:

1
[email protected]??? There is an issue quite similar to yours, at vue-cli on GitHub. You seem to be using an older NodeJS version. Whats your output for node --version?martinczerwi
node --version = v4.2.6rod fisher
upgraded NodeJS version to v8.8.1 using sudo n stable - problem solved - thank you for the assistancerod fisher

1 Answers

4
votes

Perhaps node verison is too low. update your node version using

npm install -g n 
sudo n stable  
sudo npm install npm -g

when you node -v find there is no change, but try to init vue project again.