我尝试使用创建一个项目
$ vue init webpack test
并出现以下错误
/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
不幸的是,没有创建“test”目录。
我在 Windows 10 上的 Ubuntu 上使用 Bash 以及以下 NPM 软件包:
最佳答案
可能是node版本太低了。 使用
npm install -g n
sudo n stable
sudo npm install npm -g
更新您的节点版本
当你node -v 发现没有变化,但尝试再次初始化vue项目。
关于bash - Vue init webpack 测试 - 未创建项目 - 严格模式错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47012314/