Установка беседки на Heroku
Я развернул приложение, развертывание прошло успешно. Но я обнаружил, что экспресс отсутствует в package.json, поэтому приложение не работает. Я добавил экспресс в список зависимостей в пакете, после повторного развертывания я обнаружил, что экспресс все еще отсутствует, поэтому я добавил файл bower.json с зависимостями для запуска postinstall: bower install
команда в package.json scripts:{}
список, так что экспресс будет установлен на сервере через Bower. Но проблема, с которой я сталкиваюсь сейчас:
To https://git.heroku.com/video-conf.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/video-conf.git'
$ git push heroku master
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.07 KiB | 0 bytes/s, done.
Total 7 (delta 4), 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: Loading 2 from cacheDirectories (default):
remote: - node_modules
remote: - bower_components (not cached - skipping)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote:
remote: > simplewebrtc@2.2.1 postinstall /tmp/build_64e36956fbd8af8e4284fce25bf3edc3
remote: > bower install
remote:
remote: bower localmedia#^2.1.0 not-cached https://github.com/otalk/localmedia.git#^2.1.0
remote: bower localmedia#^2.1.0 resolve https://github.com/otalk/localmedia.git#^2.1.0
remote: bower bower#1.7.9 not-cached https://github.com/theshock/atomjs.git#1.7.9
remote: bower bower#1.7.9 resolve https://github.com/theshock/atomjs.git#1.7.9
remote: bower express#4.x.x not-cached https://github.com/strongloop/express.git#4.x.x
remote: bower express#4.x.x resolve https://github.com/strongloop/express.git#4.x.x
remote: bower socket.io-client#1.3.7 not-cached https://github.com/LearnBoost/socket.io-client.git#1.3.7
remote: bower socket.io-client#1.3.7 resolve https://github.com/LearnBoost/socket.io-client.git#1.3.7
remote: bower wildemitter#1.x not-cached https://github.com/HenrikJoreteg/wildemitter.git#1.x
remote: bower wildemitter#1.x resolve https://github.com/HenrikJoreteg/wildemitter.git#1.x
remote: bower webrtcsupport#^2.2.0 not-cached https://github.com/HenrikJoreteg/webrtcsupport.git#^2.2.0
remote: bower webrtcsupport#^2.2.0 resolve https://github.com/HenrikJoreteg/webrtcsupport.git#^2.2.0
remote: bower rtcpeerconnection#^5.1.1 not-cached https://github.com/otalk/rtcpeerconnection.git#^5.1.1
remote: bower rtcpeerconnection#^5.1.1 resolve https://github.com/otalk/rtcpeerconnection.git#^5.1.1
remote: bower request#^2.72.0 not-cached https://github.com/mikeal/request.git#^2.72.0
remote: bower request#^2.72.0 resolve https://github.com/mikeal/request.git#^2.72.0
remote: bower wildemitter#1.x checkout v1.2.0
remote: bower socket.io-client#1.3.7 checkout 1.3.7
remote: bower localmedia#^2.1.0 checkout 2.1.1
remote: bower express#4.x.x checkout 4.14.0
remote: bower rtcpeerconnection#^5.1.1 checkout v5.2.0
remote: bower request#^2.72.0 checkout v2.78.1
remote: bower wildemitter#1.x mismatch Version declared in the json (1.1.0) is different than the resolved one (1.2.0)
remote: bower localmedia#^2.1.0 resolved https://github.com/otalk/localmedia.git#2.1.1
remote: bower wildemitter#1.x resolved https://github.com/HenrikJoreteg/wildemitter.git#1.2.0
remote: bower rtcpeerconnection#^5.1.1 resolved https://github.com/otalk/rtcpeerconnection.git#5.2.0
remote: bower socket.io-client#1.3.7 resolved https://github.com/LearnBoost/socket.io-client.git#1.3.7
remote: bower request#^2.72.0 resolved https://github.com/mikeal/request.git#2.78.1
remote: bower express#4.x.x resolved https://github.com/strongloop/express.git#4.14.0
remote: bower attachmediastream#^1.4.1 ENOTFOUND Package attachmediastream not found
remote:
remote: npm ERR! Linux 3.13.0-100-generic
remote: npm ERR! argv "/tmp/build_64e36956fbd8af8e4284fce25bf3edc3/.heroku/node/bin/node" "/tmp/build_64e36956fbd8af8e4284fce25bf3edc3/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_64e36956fbd8af8e4284fce25bf3edc3/.npmrc"
remote: npm ERR! node v5.11.1
remote: npm ERR! npm v3.8.6
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! simplewebrtc@2.2.1 postinstall: `bower install`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the simplewebrtc@2.2.1 postinstall script 'bower 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 simplewebrtc package,
remote: npm ERR! not with npm itself.
remote: npm ERR! Tell the author that this fails on your system:
remote: npm ERR! bower install
remote: npm ERR! You can get information on how to open an issue for this project with:
remote: npm ERR! npm bugs simplewebrtc
remote: npm ERR! Or if that isn't available, you can get their info via:
remote: npm ERR! npm owner ls simplewebrtc
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_64e36956fbd8af8e4284fce25bf3edc3/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 video-conf.
remote:
To https://git.heroku.com/video-conf.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/video-conf.git'
Даже после удаления postinstall
команда из package.json и полное удаление файла bower.json У меня та же проблема с консолью при развертывании приложения.
1 ответ
Если bower не установлен глобально на вашем сервере, это может быть путь:
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
}