Heroku推送拒绝了Node app.js

时间:2013-04-27 11:10:56

标签: node.js heroku socket.io heroku-toolbelt

我不知道为什么我的Heroku推送拒绝Node.js应用程序.. 模块安装正确。
我使用的是socket.io和express
错误:

   C:\Users\Tk-\talha-express-chat2>heroku create talha-express-chat2
  Creating talha-express-chat2... done, region is us
  http://talha-express-chat2.herokuapp.com/ | git@heroku.com:talha-express-chat2.g
  it
  Git remote heroku added

  C:\Users\Tk-\talha-express-chat2>git push heroku master
 Counting objects: 1590, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (1356/1356), done.
  Writing objects: 100% (1590/1590), 4.25 MiB | 86 KiB/s, done.
  Total 1590 (delta 148), reused 0 (delta 0)

  -----> Node.js app detected
  -----> Resolving engine versions
   Using Node.js version: 0.6.20
   Using npm version: 1.2.18
  -----> Fetching Node.js binaries
  -----> Vendoring node into slug
 -----> Installing dependencies with npm
   npm WARN package.json talha-express-chat2@0.0.1 No README.md file found!
   npm WARN package.json talha-express-chat2@0.0.1 No README.md file found!

   > ws@0.4.25 install /tmp/build_3f3ay6peny24/node_modules/socket.io/node_m
  odules/socket.io-client/node_modules/ws
   > (node-gyp rebuild 2> builderror.log) || (exit 0)

   make: Entering directory `/tmp/build_3f3ay6peny24/node_modules/socket.io/
 node_modules/socket.io-client/node_modules/ws/build'
     CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
     SOLINK_MODULE(target) Release/obj.target/bufferutil.node
     SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
     COPY Release/bufferutil.node
     CXX(target) Release/obj.target/validation/src/validation.o
     SOLINK_MODULE(target) Release/obj.target/validation.node
     SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
     COPY Release/validation.node
   make: Leaving directory `/tmp/build_3f3ay6peny24/node_modules/socket.io/n
 ode_modules/socket.io-client/node_modules/ws/build'
   npm ERR! cb() never called!
   npm ERR! not ok code undefined
   npm ERR! cb() never called!
   npm ERR! not ok code 1
 !     Failed to rebuild dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

To git@heroku.com:talha-express-chat2.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:talha-express-chat2.git' 



的package.json:

 {
  "name": "talha-express-chat2",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "express": "~2.5.8",
    "ejs": "~0.7.1",
    "socket.io": "~0.9.6"
 },
  "engines": {
    "node": "0.6.x"
  }
}

1 个答案:

答案 0 :(得分:1)

我自己发现了问题.....问题出在package.json中,用这个新的替换我的旧package.json删除错误。

{
  "name": "chat-er",
  "version": "0.0.1",
  "private": true,
  "scripts": {
  "start": "node app"
 },

  "dependencies": {
    "express": "2.5.11", 
    "socket.io": "0.9.13"
  },
    "engines": {
     "node": "0.10.x",
     "npm": "1.2.x"
  }
}