vue创建项目时报错

在安装了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了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容