2017-07-31 81 views
0

我已經使用以下命令更新了角度:npm update -g,npm upgrade -g並且現在我在使用ng serve時遇到了該錯誤。更新後的角度cli錯誤

-f--force標誌
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

回答

0

第一行說,這一切它沒有正確安裝

步驟1.

NPM卸載-g角CLI

步驟2. NPM cache clean

第3步。 npm install -g angular-cli @ latest

然後,您可以使用ng new myapp創建新項目