赞
踩
vue init webpack my-project
C:\Users\computer\AppData\Roaming\npm\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:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:1003:
解决方法:
1.先检查npm和node的版本
查看npm版本:npm -v
升级npm: npm install -g npm
查看node版本:node -v
升级node版本:https://nodejs.org/ 官网现在下载最新的node安装
2.卸载vue-cli
npm uninstall -g vue-cli
3.重新安装vue-cli
npm install -g vue-cli
4.再运行vue init webpack my-project 成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。