【问题标题】:Heroku push rejected for Node app.jsHeroku 推送拒绝 Node app.js
【发布时间】:2013-04-21 12:16:44
【问题描述】:

我不知道为什么我的 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"
  }
}

【问题讨论】:

  • 听起来可能是缓存问题。你可能想试试sudo npm cache clear
  • 删除本地文件夹中的 node_modules 目录,然后进行 npm 安装,它在本地工作吗?您提到的版本可能不兼容
  • 是的,在本地工作正常,我还使用工头开始检查它,工作正常。
  • npm 缓存清除不起作用...
  • 有什么理由运行旧版本的节点? (0.6.x)

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


【解决方案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"
  }
}

【讨论】:

    猜你喜欢
    • 2017-01-09
    • 2021-09-22
    • 1970-01-01
    • 1970-01-01
    • 2013-02-22
    • 1970-01-01
    • 2021-12-13
    • 1970-01-01
    相关资源
    最近更新 更多