2017-11-15 2 views
0

heroku에 각도 4 응용 프로그램을 배포하려고하지만 제대로 dpeloy가 실행되지 않습니다. 로컬 모든 예상대로 잘 작동합니다. 여기heroku에 각도 4 + typescript가 배포되지 않습니다.

파일 :

package.json

{ 
    "name": "webcli2", 
    "version": "0.0.0", 
    "license": "MIT", 
    "main": "app.js", 
    "scripts": { 
    "ng": "ng", 
    "start": "node app.js", 
    "build": "ng build", 
    "test": "ng test", 
    "lint": "ng lint", 
    "e2e": "ng e2e", 
    "postinstall": "ng build --aot --target=production" 
    }, 
    "engines": { 
    "node": "6.11.3", 
    "npm": "3.10.10" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/animations": "4.2.4", 
    "@angular/cli": "1.4.3", 
    "@angular/common": "4.2.4", 
    "@angular/compiler": "4.2.4", 
    "@angular/compiler-cli": "4.2.4", 
    "@angular/core": "4.2.4", 
    "@angular/forms": "4.2.4", 
    "@angular/http": "4.2.4", 
    "@angular/platform-browser": "4.2.4", 
    "@angular/platform-browser-dynamic": "4.2.4", 
    "@angular/router": "4.2.4", 
    "@auth0/angular-jwt": "1.0.0-beta.9", 
    "bootstrap": "3.3.7", 
    "core-js": "2.4.1", 
    "express": "4.16.2", 
    "grunt": "1.0.1", 
    "grunt-cli": "1.2.0", 
    "grunt-contrib-sass": "*", 
    "grunt-contrib-watch": "*", 
    "ngx-bootstrap": "1.9.3", 
    "rxjs": "5.4.2", 
    "vue-carousel-3d": "0.1.18", 
    "zone.js": "0.8.14", 
    "typescript": "2.3.3" 
    }, 
    "devDependencies": { 
    ... 
    } 

app.js

const express = require('express'); 
const app = express(); 
const path = require('path'); 


app.use(express.static(path.join(__dirname,'dist'))); 
app.listen(process.env.PORT || 8080); 
app.get('/*', function (req,res) => { 
    res.sendFile(path.join(__dirname,'/dist/index.html')); 
}); 

console.log('console listening'); 

Procfile 웹 : NPM 오류에 대한

을 시작 :이있어 :

remote:  @angular/[email protected] requires [email protected]'>=2.1.0 <2.4.0' but 2.6.1 was found instead. 
remote:  Using this version can result in undefined behaviour and difficult to debug problems. 
remote:   
remote:  Please run the following command to install a compatible version of TypeScript. 
remote:   
remote:  npm install [email protected]'>=2.1.0 <2.4.0' 
remote:   
remote:  To disable this warning run "ng set --global warnings.typescriptMismatch=false". 
remote:   
remote:  11% building modules 13/13 modules 0 activeTemplate parse warnings: 
remote:  The <template> element is deprecated. Use <ng-template> instead (" 
remote:  [WARNING ->]<template [ngIf]="!isClosed"> 
remote:  <div [class]="'alert alert-' + type" role="alert" [ngClass]="classes""): ng:///tmp/build_1e53727d0184bdda3a3ece784898bf98/node_modules/ngx-bootstrap/alert/[email protected]:0 
remote:  Warning: Can't resolve all parameters for ApplicationError in /tmp/build_1e53727d0184bdda3a3ece784898bf98/src/app/util/applicationError.service.ts: (?). This will become an error in Angular v5.x 
remote:  Warning: Can't resolve all parameters for ApplicationError in /tmp/ build_1e53727d0184bdda3a3ece784898bf98/src/app/util/applicationError.service.ts: (?). This will become an error in Angular v5.x 
Date: 2017-11-14T10:33:21.586Z 
remote:  Hash: 5582f12f0052b6c3a94c 
remote:  Time: 22622ms 
remote:  chunk {0} styles.de3b0b246fb3804809f9.bundle.css (styles) 133 kB {3} [initial] [rendered] 
remote:  chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered] 
remote:  chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered] 
remote:  chunk {3} inline.ebdb3a382088c7f31aee.bundle.js (inline) 1.45 kB [entry] [rendered] 
remote:   
remote:  ERROR in /tmp/build_1e53727d0184bdda3a3ece784898bf98/src/app/services/auth/user/user.service.ts (73,75): Value of type '() => any' has no properties in common with type '{ headers?: HttpHeaders; observe?: "body"; params?: HttpParams; reportProgress?: boolean; respons...'. Did you mean to call it? 
remote:  ERROR in /tmp/build_1e53727d0184bdda3a3ece784898bf98/src/app/services/auth/user/user.service.ts (82,39): Type 'Headers' has no properties in common with type 'RequestOptionsArgs'. 
remote:  ERROR in /tmp/build_1e53727d0184bdda3a3ece784898bf98/src/app/services/auth/auth.service.ts (16,34): Cannot find module '../../util/applicationerror.service'. 
remote:  ERROR in /tmp/build_1e53727d0184bdda3a3ece784898bf98/src/app/services/auth/auth.service.ts (111,5): Type 'Observable<void | {}>' is not assignable to type 'Observable<{}>'. 
remote:   Type 'void | {}' is not assignable to type '{}'. 
remote:   Type 'void' is not assignable to type '{}'. 
remote:   
remote:  npm ERR! Linux 3.13.0-133-generic 
remote:  npm ERR! argv "/tmp/build_1e53727d0184bdda3a3ece784898bf98/.heroku/ node/bin/node" "/tmp/build_1e53727d0184bdda3a3ece784898bf98/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/ build_1e53727d0184bdda3a3ece784898bf98/.npmrc" 
remote:  npm ERR! node v6.11.3 
remote:  npm ERR! npm v3.10.10 
remote:  npm ERR! code ELIFECYCLE 
remote:  npm ERR! [email protected] postinstall: `ng build --aot --target=production` 
remote:  npm ERR! Exit status 1 
remote:  npm ERR! 
remote:  npm ERR! Failed at the [email protected] postinstall script 'ng build --aot --target=production'. 
remote:  npm ERR! Make sure you have the latest version of node.js and npm installed. 
remote:  npm ERR! If you do, this is most likely a problem with the webcli2 package, 
remote:  npm ERR! not with npm itself. 
remote:  npm ERR! Tell the author that this fails on your system: 
remote:  npm ERR!  ng build --aot --target=production 
remote:  npm ERR! You can get information on how to open an issue for this project with: 
remote:  npm ERR!  npm bugs webcli2 
remote:  npm ERR! Or if that isn't available, you can get their info via: 
remote:  npm ERR!  npm owner ls webcli2 
remote:  npm ERR! There is likely additional logging output above. 
remote:   
remote:  npm ERR! Please include the following file with any support request: 
remote:  npm ERR!  /tmp/build_1e53727d0184bdda3a3ece784898bf98/npm-debug.log 
remote: 
remote: -----> Build failed 

그래서 Heroku가 이미 2.6.1을 가지고,이 경우, 이전 타이프 라이터 버전을 설치 할 수 없다는 것을 보이는,하지만 난 파일을 가지고있는 사람은 2.3.3

이가이다 이 오류의 원인은 무엇입니까?

Brunos-MBP:webcli brunolopes$ ng build -aot 
12% building modules 18/18 modules 0 activeWarning: Can't resolve all 
parameters for ApplicationError in 
/Users/brunolopes/development/workspace2016/ 
webroot/winpi/webcli/src/app/util/applicationerror.service.ts: (?). This will become an error in Angular v5.x 
Warning: Can't resolve all parameters for ApplicationError in 

/Users/brunolopes/development/workspace2016/ 
webroot/winpi/webcli/src/app/util/applicationerror.service.ts: (?). This will become an error in Angular 
v5.x 
Template parse warnings: 
The <template> element is deprecated. Use <ng-template> instead (" 
[WARNING ->]<template [ngIf]="!isClosed"> 
<div [class]="'alert alert-' + type" role="alert" [ngClass]="classes""): ng:///Users/brunolopes/development/workspace2016/webroot/winpi/webcli/node_modules/ngx-bootstrap/alert/[email protected]:0 
Date: 2017-11-16T07:51:16.467Z               
Hash: 32f3a3b7f72daf78e799 
Time: 53961ms 
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB 
[entry] [rendered] 
chunk {main} main.bundle.js, main.bundle.js.map (main) 515 kB {vendor} 
[initial] [rendered] 
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map 
(polyfills) 
217 kB {inline} [initial] [rendered] 
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 153 kB 
{inline} [initial] [rendered] 
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.43 MB 
[initial] [rendered] 
Brunos-MBP:webcli brunolopes$ 

감사

B

+0

로컬로 빌드 할 수 있습니까? –

+0

몇 가지 경고가 있지만 성공적으로 끝나는 예 –

답변

0

나는 4.4.6에 각 버전을 변경하고이 문제를 해결 :

로컬 나는 얻었다.

실수로 내 로컬 환경에있는 패키지입니다. package.json에 4.2.4가 있습니다.

감사합니다.

관련 문제