我的angular-cli版本是beta.16
我尝试通过以下命令更新
npm uninstall -g angular-cli @angular/cli npm cache clean npm install -g @angular/cli@latest
在我尝试运行任何ng命令后成功安装
ng version ng help
我收到了这个错误
ng help /usr/local/lib/node_modules/@angular/cli/models/config/config.js:15 constructor(_configPath,schema,configJson,fallbacks = []) { ^ SyntaxError: Unexpected token = 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 Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/config.js:2:18) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10)
您需要节点版本6.x或更高版本
原文链接:/angularjs/143981.html