1

我不知道为什么 Node.js 应用程序拒绝了我的 Heroku 推送。模块已正确安装。
我正在使用 socket.io 并表示
错误:

   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' 



包.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"
  }
}
4

1 回答 1

1

我自己发现了问题......问题出在 package.json 中,用这个新的 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"
  }
}
于 2013-04-27T16:34:52.580 回答