2016-08-12 88 views
1

我已經使用ng new project命令生成了我的angualr2應用程序,現在我正試圖將我的項目放在heroku上,不幸的是,我面臨着一個錯誤,當我推開git push heroku master我的代碼:未能推送一些文件到'https://git.heroku.com/easy-instagram.git'

Counting objects: 65, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (62/62), done. 
Writing objects: 100% (65/65), 363.09 KiB | 0 bytes/s, done. 
Total 65 (delta 5), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Node.js app detected 
remote: 
remote: -----> Creating runtime environment 
remote: 
remote:  NPM_CONFIG_LOGLEVEL=error 
remote:  NPM_CONFIG_PRODUCTION=true 
remote:  NODE_ENV=production 
remote:  NODE_MODULES_CACHE=true 
remote: 
remote: -----> Installing binaries 
remote:  engines.node (package.json): unspecified 
remote:  engines.npm (package.json): unspecified (use default) 
remote: 
remote:  Resolving node version (latest stable) via semver.io... 
remote:  Downloading and installing node 5.11.1... 
remote:  Using default npm version: 3.8.6 
remote: 
remote: -----> Restoring cache 
remote:  Skipping cache restore (new runtime signature) 
remote: 
remote: -----> Building dependencies 
remote:  Installing node modules (package.json) 
remote: 
remote:  > [email protected] postinstall /tmp/build_a0673d10d05036142a147f64099bd6fb 
remote:  > typings install 
remote: 
remote:  sh: 1: typings: not found 
remote: 
remote:  npm ERR! Linux 3.13.0-91-generic 
remote:  npm ERR! argv "/tmp/build_a0673d10d05036142a147f64099bd6fb/.heroku/node/bin/node" "/tmp/build_a0673d10d05036142a147f64099bd6fb/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_a0673d10d05036142a147f64099bd6fb/.npmrc" 
remote:  npm ERR! node v5.11.1 
remote:  npm ERR! npm v3.8.6 
remote:  npm ERR! file sh 
remote:  npm ERR! code ELIFECYCLE 
remote:  npm ERR! errno ENOENT 
remote:  npm ERR! syscall spawn 
remote:  npm ERR! [email protected] postinstall: `typings install` 
remote:  npm ERR! spawn ENOENT 
remote:  npm ERR! 
remote:  npm ERR! Failed at the [email protected] postinstall script 'typings install'. 
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 qminder package, 
remote:  npm ERR! not with npm itself. 
remote:  npm ERR! Tell the author that this fails on your system: 
remote:  npm ERR!  typings install 
remote:  npm ERR! You can get information on how to open an issue for this project with: 
remote:  npm ERR!  npm bugs qminder 
remote:  npm ERR! Or if that isn't available, you can get their info via: 
remote:  npm ERR!  npm owner ls qminder 
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_a0673d10d05036142a147f64099bd6fb/npm-debug.log 
remote: 
remote: -----> Build failed 
remote: 
remote:  We're sorry this build is failing! You can troubleshoot common issues here: 
remote:  https://devcenter.heroku.com/articles/troubleshooting-node-deploys 
remote: 
remote:  Some possible problems: 
remote: 
remote:  - Node version not specified in package.json 
remote:  https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version 
remote: 
remote:  Love, 
remote:  Heroku 
remote: 
remote: !  Push rejected, failed to compile Node.js app. 
remote: 
remote: !  Push failed 
remote: Verifying deploy... 
remote: 
remote: !  Push rejected to easy-instagram. 
remote: 
To https://git.heroku.com/easy-instagram.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/easy-instagram.git' 

所以,有什麼,我可以添加到我的項目,以解決這個問題?

我已經碼的手動添加的節點版本我config.json文件,但它仍然有同樣的錯誤抱怨:

"devDependencies": { 
    "angular-cli": "1.0.0-beta.10", 
    "codelyzer": "0.0.20", 
    "ember-cli-inject-live-reload": "1.4.0", 
    "jasmine-core": "2.4.1", 
    "jasmine-spec-reporter": "2.5.0", 
    "karma": "0.13.22", 
    "karma-chrome-launcher": "0.2.3", 
    "karma-jasmine": "0.3.8", 
    "protractor": "3.3.0", 
    "ts-node": "0.5.5", 
    "tslint": "3.11.0", 
    "typescript": "1.8.10", 
    "typings": "1.3.1", 
    "node":"4.4.0" 
    } 

回答

0

貌似Heroku的沒有安裝您的devDependencies 有兩種可能的變體如何解決它:

  • 移動typingsdependencies

"dependencies": { ... "typings": "^2.1.0", ...

OR

  • NPM_CONFIG_PRODUCTION需要被設置爲false的Heroku安裝devDependencies
相關問題