2017-07-31 8 views
0

次のコマンドを使用して角度を更新しました:npm update -gnpm upgrade -gここでng serveを使用するとエラーが発生しました。更新後の角度cliエラー

The "@angular/compiler-cli" package was not properly installed. 
Error: The "@angular/compiler-cli" package was not properly installed. 
    at Object.<anonymous> (/Users/lechucico/Documents/LegacyLife/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:14:11) 
    at Module._compile (module.js:569:30) 
    at Object.Module._extensions..js (module.js:580:10) 
    at Module.load (module.js:503:32) 
    at tryModuleLoad (module.js:466:12) 
    at Function.Module._load (module.js:458:3) 
    at Module.require (module.js:513:17) 
    at require (internal/module.js:11:18) 
    at Object.<anonymous> (/Users/lechucico/Documents/LegacyLife/node_modules/@angular/cli/tasks/eject.js:10:19) 
    at Module._compile (module.js:569:30) 
    at Object.Module._extensions..js (module.js:580:10) 
    at Module.load (module.js:503:32) 
    at tryModuleLoad (module.js:466:12) 
    at Function.Module._load (module.js:458:3) 
    at Module.require (module.js:513:17) 
    at require (internal/module.js:11:18) 
+0

正しいフォルダに入っていますか?私は空の 'node_modules'フォルダのあるフォルダでそれを実行しています... – Boland

+0

私は自分のプロジェクトフォルダにいるので、そうです。 – Lechucico

答えて

1

それが動作します-f--forceフラグを付けて使用します。

またはこのgithub issue

0

で行く最初の行は、それが適切に

ステップ1.

NPMのアンインストール-g角度-CLI

ステップ2. NPMをインストールしていないそれをすべて言いますキャッシュクリーン

ステップ3. npm install -g angular-cli @ latest

ng new myappを使用して新しいプロジェクトを作成できます