0

I have simple project. link: https://github.com/Tyvain/BTCash

locally I launch it like that:

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

I try "github deployement" in heroku but got:

-----> 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

How should I deploy and launch it on heroku? Should I use travis CI for that?

1 Answer 1

2

NPM is trying to run the npm run typings install postinstall script, but the typings package is in your devDependencies section in your package.json.

Because the NODE_ENV on Heroku is set to "production", those packages won't be installed, so that npm postinstall script won't be able to complete on Heroku.

Try moving typings to the dependencies section in package.json.

Also, read the Heroku NodeJS development documentation for more useful stuff. For instance, you should really be specifying a NodeJS and NPM version in your package.json.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.