2016-12-04 7 views
0

私は単純なプロジェクトを持っています。 リンク:https://github.com/Tyvain/BTCashHerokuノード/角度:アプリケーションとサーバーを展開

ローカルに私はそのようにそれを起動します。

npm install 
cd BTCash/server/ 
node app.js 
cd BTCash/ 
npm start 

私はHerokuの中に "githubののdeployement" を試みるが、得た:

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

    NPM_CONFIG_LOGLEVEL=error 
    NPM_CONFIG_PRODUCTION=true 
    NODE_ENV=production 
    NODE_MODULES_CACHE=true 
-----> Installing binaries 
    engines.node (package.json): unspecified 
    engines.npm (package.json): unspecified (use default) 

    Resolving node version (latest stable) via semver.io... 
    Downloading and installing node 6.9.1... 
    Using default npm version: 3.10.8 
-----> Restoring cache 
    Skipping cache restore (new runtime signature) 
-----> Building dependencies 
    Installing node modules (package.json) 

    > [email protected] postinstall /tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3 
    > npm run typings install 


    > [email protected] typings /tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3 
    > typings "install" 

    sh: 1: typings: not found 

    npm ERR! Linux 3.13.0-100-generic 
    npm ERR! argv "/tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/.heroku/node/bin/node" "/tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/.heroku/node/bin/npm" "run" "typings" "install" 
    npm ERR! node v6.9.1 
    npm ERR! npm v3.10.8 
    npm ERR! file sh 
    npm ERR! code ELIFECYCLE 
    npm ERR! errno ENOENT 
    npm ERR! syscall spawn 
    npm ERR! [email protected] typings: `typings "install"` 
    npm ERR! spawn ENOENT 
    npm ERR! 
    npm ERR! Failed at the [email protected] typings script 'typings "install"'. 
    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 angular package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  typings "install" 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs angular 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls angular 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  /tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/npm-debug.log 

    npm ERR! Linux 3.13.0-100-generic 
    npm ERR! argv "/tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/.heroku/node/bin/node" "/tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/.npmrc" 
    npm ERR! node v6.9.1 
    npm ERR! npm v3.10.8 
    npm ERR! code ELIFECYCLE 
    npm ERR! [email protected] postinstall: `npm run typings install` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] postinstall script 'npm run typings install'. 
    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 angular package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  npm run typings install 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs angular 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls angular 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  /tmp/build_7594b95a41ba0663394176646f6e85f5/Tyvain-BTCash-9a16ec3/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 

    Some possible problems: 

    - Node version not specified in package.json 
    https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version 

    Love, 
    Heroku 

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

はどのように展開し、Herokuの上でそれを起動する必要がありますか?そのためにトラビスCIを使うべきですか?

答えて

2

NPMはnpm run typings installポストインストールスクリプトを実行しようとしているが、typingsパッケージには、あなたのpackage.jsonであなたのdevDependenciesセクションにあります。

HerokuのNODE_ENVが "production"に設定されているため、これらのパッケージはインストールされないため、npm postinstallスクリプトはHerokuで完了できません。

typingsdependenciesセクションのpackage.jsonに移動してみてください。

また、より有用なものについてはHeroku NodeJS development documentationをお読みください。たとえば、実際にはpackage.jsonにNodeJSとNPMのバージョンを指定する必要があります。

関連する問題