美文网首页
vue创建项目时报错

vue创建项目时报错

作者: 小楠的代码生涯 | 来源:发表于2017-10-12 16:43 被阅读0次

在安装了node、npm和vue之后,想创建个项目。执行 命令 npm install -g vue-cli 时一切正常,但是到 vue init webpack my-project 时报错了,错误代码如下

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:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

(非严格模式下不支持块级作用域声明)。检查了一下哪儿都没错啊!
后来更新了node.js之后,一切就OK了。

相关文章

网友评论

      本文标题:vue创建项目时报错

      本文链接:https://www.haomeiwen.com/subject/bbroyxtx.html