凉亭安装在Heroku上

时间:2016-11-04 17:27:29

标签: heroku deployment npm bower node-modules

我已经部署了应用程序,部署成功了。但是我发现package.json中缺少express,所以应用程序无法运行。我已经在包中添加了express依赖列表,再次部署之后我看到express仍然缺少所以我添加了带依赖关系的bower.json文件来在package.json postinstall: bower install列表中运行scripts:{}命令,这样express将通过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'

即使从package.json中删除postinstall命令并完全删除了bower.json文件,我在部署应用程序时也会在控制台上遇到同样的问题。

1 个答案:

答案 0 :(得分:0)

除非您的服务器上全局安装了凉亭,否则可能是这样:

"scripts": {
    "postinstall": "./node_modules/bower/bin/bower install"
}