2017-03-24 2 views
1

안녕하세요. 나는 이상한 오류가 있습니다. 나는 최근 내 노트북에 모든 것을 재설치했다. 이제 문제가 생겼습니다. 매번 내가 package.json에서이 구성을 사용하면 heroku로 밀어 넣는 데 오류가 발생합니다.Node.js 앱을 heroku에 컴파일하지 못했습니다.

{ 
    "name": "mrfrederiksen", 
    "version": "0.0.0", 
    "license": "MIT", 
    "scripts": { 
    "postinstall": "ng build --aot -prod", 
    "start": "node server.js" 
    }, 
    "engines": { 
    "node": "7.7.3", 
    "npm": "4.1.2" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/cli": "1.0.0", 
    "@angular/common": "^4.0.0", 
    "@angular/compiler": "^4.0.0", 
    "@angular/core": "^4.0.0", 
    "@angular/forms": "^4.0.0", 
    "@angular/http": "^4.0.0", 
    "@angular/platform-browser": "^4.0.0", 
    "@angular/platform-browser-dynamic": "^4.0.0", 
    "@angular/router": "^4.0.0", 
    "core-js": "^2.4.1", 
    "express": "^4.15.2", 
    "rxjs": "^5.1.0", 
    "zone.js": "^0.8.4" 
    }, 
    "devDependencies": { 
    "@angular/compiler-cli": "^4.0.0", 
    "@types/jasmine": "2.5.38", 
    "@types/node": "~6.0.60", 
    "codelyzer": "~2.0.0", 
    "jasmine-core": "~2.5.2", 
    "jasmine-spec-reporter": "~3.2.0", 
    "karma": "~1.4.1", 
    "karma-chrome-launcher": "~2.0.0", 
    "karma-cli": "~1.0.1", 
    "karma-jasmine": "~1.1.0", 
    "karma-jasmine-html-reporter": "^0.2.2", 
    "karma-coverage-istanbul-reporter": "^0.2.0", 
    "protractor": "~5.1.0", 
    "ts-node": "~2.0.0", 
    "tslint": "~4.5.0", 
    "typescript": "~2.2.0" 
    } 
} 

하지만 ... 내가 설치 한 모든 작품 이전 버전이 친구에서이 기부를 사용하는 경우. 최신 버전으로 내 자신을 사용하는 경우

{ 
    "name": "mrfrederiksen", 
    "version": "0.0.0", 
    "license": "MIT", 
    "scripts": { 
    "postinstall": "ng build --aot -prod", 
    "start": "node server.js" 
    }, 
    "engines": { 
    "node": "6.9.4", 
    "npm": "3.10.10" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/cli": "1.0.0-rc.0", 
    "@angular/common": "^2.4.0", 
    "@angular/compiler": "^2.4.0", 
    "@angular/core": "^2.4.0", 
    "@angular/forms": "^2.4.0", 
    "@angular/http": "^2.4.0", 
    "@angular/platform-browser": "^2.4.0", 
    "@angular/platform-browser-dynamic": "^2.4.0", 
    "@angular/router": "^3.4.0", 
    "core-js": "^2.4.1", 
    "express": "^4.15.2", 
    "rxjs": "^5.1.0", 
    "zone.js": "^0.7.6" 
    }, 
    "devDependencies": { 
    "@angular/compiler-cli": "^2.4.0", 
    "@types/jasmine": "2.5.38", 
    "@types/node": "~6.0.60", 
    "codelyzer": "~2.0.0", 
    "jasmine-core": "~2.5.2", 
    "jasmine-spec-reporter": "~3.2.0", 
    "karma": "~1.4.1", 
    "karma-chrome-launcher": "~2.0.0", 
    "karma-cli": "~1.0.1", 
    "karma-jasmine": "~1.1.0", 
    "karma-jasmine-html-reporter": "^0.2.2", 
    "karma-coverage-istanbul-reporter": "^0.2.0", 
    "protractor": "~5.1.0", 
    "ts-node": "~2.0.0", 
    "tslint": "~4.4.2", 
    "typescript": "~2.0.0" 
    } 
} 

여기 내 오류 콘솔 메시지입니다. 나는 고궁 박물원, 노드, 타이프 라이터 및 최신 버전으로 NG가-cli를 업그레이드 한 후

-----> Node.js app detected 
-----> Creating runtime environment 

     NPM_CONFIG_LOGLEVEL=error 
     NPM_CONFIG_PRODUCTION=true 
     NODE_VERBOSE=false 
     NODE_ENV=production 
     NODE_MODULES_CACHE=true 
-----> Installing binaries 
     engines.node (package.json): 7.7.3 
     engines.npm (package.json): 4.1.2 

     Downloading and installing node 7.7.3... 
     npm 4.1.2 already installed with node 
-----> Restoring cache 
     Skipping cache restore (new runtime signature) 
-----> Building dependencies 
     Installing node modules (package.json) 

     > [email protected] install /tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/node-sass 
     > node scripts/install.js 

     Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.1/linux-x64-51_binding.node 
     Download complete 
     Binary saved to /tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/node-sass/vendor/linux-x64-51/binding.node 
     Caching binary to /app/.npm/node-sass/4.5.1/linux-x64-51_binding.node 

     > [email protected] postinstall /tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/node-sass 
     > node scripts/build.js 

     Binary found at /tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/node-sass/vendor/linux-x64-51/binding.node 
     Testing binary 
     Binary is fine 

     > [email protected] postinstall /tmp/build_5a8b797790355e544758529cdf0f5b1a 
     > ng build --aot -prod 

     The "@angular/compiler-cli" package was not properly installed. 
     Error: The "@angular/compiler-cli" package was not properly installed. 
     at Object.<anonymous> (/tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/@ngtools/webpack/src/index.js:14:11) 
     at Module._compile (module.js:571:32) 
     at Object.Module._extensions..js (module.js:580:10) 
     at Module.load (module.js:488:32) 
     at tryModuleLoad (module.js:447:12) 
     at Function.Module._load (module.js:439:3) 
     at Module.require (module.js:498:17) 
     at require (internal/module.js:20:19) 
     at Object.<anonymous> (/tmp/build_5a8b797790355e544758529cdf0f5b1a/node_modules/@angular/cli/tasks/eject.js:10:19) 
     at Module._compile (module.js:571:32) 
     at Object.Module._extensions..js (module.js:580:10) 
     at Module.load (module.js:488:32) 
     at tryModuleLoad (module.js:447:12) 
     at Function.Module._load (module.js:439:3) 
     at Module.require (module.js:498:17) 
     at require (internal/module.js:20:19) 

     npm ERR! Linux 3.13.0-112-generic 
     npm ERR! argv "/tmp/build_5a8b797790355e544758529cdf0f5b1a/.heroku/node/bin/node" "/tmp/build_5a8b797790355e544758529cdf0f5b1a/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_5a8b797790355e544758529cdf0f5b1a/.npmrc" 
     npm ERR! node v7.7.3 
     npm ERR! npm v4.1.2 
     npm ERR! code ELIFECYCLE 
     npm ERR! [email protected] postinstall: `ng build --aot -prod` 
     npm ERR! Exit status 1 
     npm ERR! 
     npm ERR! Failed at the [email protected] postinstall script 'ng build --aot -prod'. 
     npm ERR! Make sure you have the latest version of node.js and npm installed. 
     npm ERR! If you do, this is most likely a problem with the mrfrederiksen package, 
     npm ERR! not with npm itself. 
     npm ERR! Tell the author that this fails on your system: 
     npm ERR!  ng build --aot -prod 
     npm ERR! You can get information on how to open an issue for this project with: 
     npm ERR!  npm bugs mrfrederiksen 
     npm ERR! Or if that isn't available, you can get their info via: 
     npm ERR!  npm owner ls mrfrederiksen 
     npm ERR! There is likely additional logging output above. 

     npm ERR! Please include the following file with any support request: 
     npm ERR!  /tmp/build_5a8b797790355e544758529cdf0f5b1a/npm-debug.log 
-----> Build failed 

     We're sorry this build is failing! You can troubleshoot common issues here: 
     https://devcenter.heroku.com/articles/troubleshooting-node-deploys 

     If you're stuck, please submit a ticket so we can help: 
     https://help.heroku.com/ 

     Love, 
     Heroku 

!  Push rejected, failed to compile Node.js app. 
!  Push failed 
+0

이 도움이 될 - http://stackoverflow.com/a/42927275/4774345 – dan

답변

0

, 나는 문제의 비슷한 종류를했다. 많은 것을 시도했지만 아무것도 효과가 없었습니다.

(ended up with "The "@angular/compiler-cli" package was not properly installed" error). 

그런 다음 다음과 같이했다 :

  1. 을 새 버전
  2. 시작 'NPM 시작'을 사용하여 작성된없는 코드를 위의 생성 된 프로젝트와 새 프로젝트 (ng를 새 [프로젝트 이름]을) 만들기 성공적으로
  3. 이전 프로젝트 'src'폴더를 새 프로젝트 폴더에 복사했습니다.
  4. 새 프로젝트 폴더의 이전 프로젝트에서 복사 된 폴더 (부트 스트랩)
  5. 'npm start'를 사용하여 프로젝트 시작

모든 것이 평소대로 작동하기 시작했습니다.

0

그냥 타이프 라이터의 v2.2.1를 업데이트하고 작동

관련 문제