2017-07-29 38 views
0

我角CLI使用NPM使用此COMMANDE線安裝:角CLI NG命令給出「意外令牌=」

npm install -g @angular/cli 

安裝與更迭完成,但是當我嘗試使用納克 COMMANDE然後我有這樣的錯誤:事先

[email protected]:/home/errabi/Desktop# ng help 
/usr/local/lib/node_modules/@angular/cli/models/config/config.js:17 
    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:3:18) 
    at Module._compile (module.js:410:26) 
    at Object.Module._extensions..js (module.js:417:10) 

這個問題感謝任何想法

+0

你安裝了什麼版本的節點? – 2017-07-29 12:31:32

+0

我使用的這個版本v4.2.6 –

+0

對於運行angular-cli,你的節點版本應該是至少6 –

回答

1

正如您所提到的,您有節點v 4.2.6 以下是根據文檔的角度/ cli的必備條件。

先決條件

CLI和生成的項目具有需要節點 6.9.0或更高的依賴關係,與NPM 3或更高在一起。

+0

問題解決了它是一個版本問題,Thx –