Obtener el error después de la actualización de Angular cli


Mi angular-cli versión era beta.16

Intento actualizar siguiendo el comando

npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g @angular/cli@latest

Después de instalar con éxito cuando intento ejecutar cualquier comando ng

ng version 
ng help

Estoy recibiendo este error

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)
Author: Boiethios, 2017-02-10

2 answers

Necesita el nodo versión 6.x o superior

Echa un vistazo aquí: https://github.com/angular/angular-cli/issues/4604

 34
Author: Ahmed Musallam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-10 22:16:48

Como se mencionó, necesita el nodo versión 6.x o superior.

Solución rápida publicada en Github por cdvillagra :

npm cache clean -f
npm install -g n
n stable

(es posible que necesite prefijar esos comandos con sudo).

También, en Ubuntu o similar, es posible que desee eliminar su versión anterior de node y luego vincular la nueva:

sudo ln -s /usr/local/bin/node /usr/bin/node

 1
Author: Shin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-13 09:35:08