Ответ 1
Вам нужна Node версия 6.x или выше
смотрите здесь: https://github.com/angular/angular-cli/issues/4604
Мой англарный клип был бета .16
Я пытаюсь обновить следующую команду
npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g @angular/[email protected]
после успешной установки, когда я пытаюсь запустить любую команду 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)
Вам нужна Node версия 6.x или выше
смотрите здесь: https://github.com/angular/angular-cli/issues/4604
Как уже упоминалось, вам нужна Node версия 6.x или выше.
Быстрое решение опубликовано на Github cdvillagra:
npm cache clean -f
npm install -g n
n stable
(вам может потребоваться префикс этих команд с помощью sudo
).
Кроме того, на Ubuntu или аналогичном вам может понадобиться удалить старую версию Node, а затем связать новую:
sudo ln -s /usr/local/bin/node /usr/bin/node