2017-02-03 35 views
1

今天早上我更新了我的cli到1.0.0-beta.30。我在1.0.0-beta.24上收到這條消息,但我的應用程序仍然會正常生成和運行,所以我只是忽略了它。現在我得到了服務的HTML shell,但我的應用程序不會啓動,並且根本沒有控制檯輸出。這裏發生了什麼事?@ angular/cli的新安裝發生了什麼? (webpack編譯默默無聞)

(我在Windows 10) CLI output

package.json

{ 
    "name": "search-app", 
    "version": "0.0.0", 
    "license": "MIT", 
    "angular-cli": {}, 
    "scripts": { 
    "ng": "ng", 
    "start": "ng serve", 
    "test": "ng test", 
    "pree2e": "webdriver-manager update --standalone false --gecko false", 
    "e2e": "protractor" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/common": "^2.3.1", 
    "@angular/compiler": "^2.3.1", 
    "@angular/core": "^2.3.1", 
    "@angular/forms": "^2.3.1", 
    "@angular/http": "^2.3.1", 
    "@angular/platform-browser": "^2.3.1", 
    "@angular/platform-browser-dynamic": "^2.3.1", 
    "@angular/router": "^3.3.1", 
    "core-js": "^2.4.1", 
    "rxjs": "^5.0.1", 
    "ts-helpers": "^1.1.1", 
    "zone.js": "^0.7.2" 
    }, 
    "devDependencies": { 
    "@angular/cli": "1.0.0-beta.30", 
    "@angular/compiler-cli": "^2.3.1", 
    "@types/jasmine": "2.5.38", 
    "@types/node": "^6.0.42", 
    "codelyzer": "~2.0.0-beta.1", 
    "jasmine-core": "2.5.2", 
    "jasmine-spec-reporter": "2.5.0", 
    "karma": "1.2.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "karma-cli": "^1.0.1", 
    "karma-jasmine": "^1.0.2", 
    "karma-remap-istanbul": "^0.2.1", 
    "protractor": "~4.0.13", 
    "ts-node": "1.2.1", 
    "tslint": "^4.3.0", 
    "typescript": "~2.0.3" 
    } 
} 

angular-cli.json

{ 
    "project": { 
    "version": "1.0.0-beta.30", 
    "name": "search-app" 
    }, 
    "apps": [ 
    { 
     "root": "src", 
     "outDir": "dist", 
     "assets": [ 
     "assets", 
     "favicon.ico" 
     ], 
     "index": "index.html", 
     "main": "main.ts", 
     "polyfills": "polyfills.ts", 
     "test": "test.ts", 
     "tsconfig": "tsconfig.json", 
     "prefix": "app", 
     "styles": [ 
     "styles.css" 
     ], 
     "scripts": [], 
     "environments": { 
     "source": "environments/environment.ts", 
     "dev": "environments/environment.ts", 
     "prod": "environments/environment.prod.ts" 
     } 
    } 
    ], 
    "e2e": { 
    "protractor": { 
     "config": "./protractor.conf.js" 
    } 
    }, 
    "lint": [ 
    { 
     "files": "src/**/*.ts", 
     "project": "src/tsconfig.json" 
    }, 
    { 
     "files": "e2e/**/*.ts", 
     "project": "e2e/tsconfig.json" 
    } 
    ], 
    "test": { 
    "karma": { 
     "config": "./karma.conf.js" 
    } 
    }, 
    "defaults": { 
    "styleExt": "css", 
    "prefixInterfaces": false, 
    "inline": { 
     "style": false, 
     "template": false 
    }, 
    "spec": { 
     "class": false, 
     "component": false, 
     "directive": false, 
     "module": false, 
     "pipe": false, 
     "service": false 
    } 
    } 
} 

tsconfig.json

{ 
    "compilerOptions": { 
    "baseUrl": "", 
    "declaration": false, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "lib": ["es6", "dom"], 
    "mapRoot": "./", 
    "module": "es6", 
    "moduleResolution": "node", 
    "outDir": "../dist/out-tsc", 
    "sourceMap": true, 
    "target": "es5", 
    "typeRoots": [ 
     "../node_modules/@types" 
    ] 
    } 
} 
+0

你可以發佈你的tsconfig?看起來有些庫在編譯時並不存在。 – Steveadoo

+0

@Steveadoo完成。 – JordanFrankfurt

回答

0

嘗試此解決方案:

這是最新的@ngtools/webpack包的 角CLI使用中的錯誤。爲了解決這個問題,你需要手動降級 包:

npm uninstall @ngtools/webpack 
npm install --save-dev @ngtools/[email protected] 

一個新的CLI版本後,你應該再次

欲瞭解更多信息,請 package.json刪除此檢查 this bug報告

https://stackoverflow.com/a/42006228/3676586

+0

完成,但結果相同。 'rm -rf'也是我的節點模塊。 'ng serve'正在開發者應用程序上工作,但似乎每個人都應該這樣做。 – JordanFrankfurt

+0

有人說'它需要在package.json上是「@ ngtools/webpack」:「1.2.4」而不是「@ ngtools/webpack」:「^ 1.2.4」',但有人回覆到beta-28.3版本,對我來說,我仍然在使用beta-26版本 –

+0

我想我會在這裏稍微回覆到26(如果我無法弄清楚)。 – JordanFrankfurt