推送被拒绝,无法编译 Node.js 应用程序 heroku [英] Push rejected, failed to compile Node.js app heroku

查看:24
本文介绍了推送被拒绝,无法编译 Node.js 应用程序 heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 git push heroku master 将我的 nodejs 应用程序推送到 heroku 时,我得到了这个:

When I tried to push my nodejs app to heroku with git push heroku master, i got this:

Counting objects: 975, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (862/862), done.
Writing objects: 100% (975/975), 3.74 MiB | 80.00 KiB/s, done.
Total 975 (delta 70), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
   Using Node.js version: 0.10.15
   Using npm version: 1.3.3
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
   npm ERR! install Couldn't read dependencies
!     Push rejected, failed to compile Node.js app

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

这是我的 package.json:

And this is my package.json:

{
  "name": "fnBoard",
  "version": "0.0.1",
  "private": true,
  "scripts": {
  "start": "node server.js"
},

  "dependencies": {
   "socket.io": "0.9.x"
},
   "engines": {
     "node": "0.10.x",
     "npm": "1.3.x"
   }
}

里面有一堆错误,我不知道为什么会这样.请帮忙.-谢谢

There's a bunch of error inside and I have no idea why this happen. please help. -thanks

推荐答案

最简单的方法是将 node_modules 添加到您的 .gitignore 中.这里有更多信息:无法将 node.js 应用程序部署到 heroku

The easiest way to make this work is to add node_modules to your .gitignore. Lots more info here: Fail to deploy node.js application to heroku

这篇关于推送被拒绝,无法编译 Node.js 应用程序 heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆