未能部署heroku应用程序 [英] failure to deploy heroku app

查看:209
本文介绍了未能部署heroku应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是错误日志:

  remote:压缩源文件...完成。 
remote:建立资料来源:remote:
remote:-----> Node.js应用程序检测到
remote:
remote:----->创建运行时环境
remote:
remote:NPM_CONFIG_LOGLEVEL =错误
remote:NPM_CONFIG_PRODUCTION = true $ b $ remote:NODE_VERBOSE = false
remote:NODE_ENV =生产
remote :NODE_MODULES_CACHE = true
remote:
remote:----->安装二进制文件
remote:engines.node(package.json):〜6.11.0
remote:engines.npm(package.json):〜5.0.3
remote:
remote:通过semver.io解析节点版本〜6.11.0 ...
remote:下载并安装节点6.11.1 ...
remote:通过semver.io解析npm版本〜5.0.3。 ..
remote:下载并安装npm 5.0.4(替换版本
3.10.10)...
remote:
remote:----->恢复缓存
remote:跳过缓存恢复(新签名)
remote:
remote:----->构建依赖关系
remote:检测到预构建(node_modules已存在)
remote:重建任何本地模块
remote:npm ERR!路径
/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js
remote:npm ERR!代码ENOENT
remote:npm ERR! errno -2
remote:npm ERR! syscall chmod
remote:npm ERR! enoent ENOENT:没有这样的文件或目录,chmod
'/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js'
remote:npm ERR! enoent这与npm无法
找到文件有关。
remote:npm ERR! enoent
remote:
remote:npm ERR!此运行的完整日志可以在以下位置找到:
remote:npm ERR! /app/.npm/_logs/2017-07-16T02_45_14_132Z-
debug.log
remote:
remote:----->构建失败的
remote:
remote:我们很抱歉这个构建失败!您可以在这里解决
的常见问题:
remote:
remote:一些可能的问题:
remote:
remote: - node_modules签入源代码管理
remote :
remote:Love,
remote:Heroku
remote:
remote:!推送被拒绝,无法编译Node.js应用程序。
remote:
remote:!推送失败
remote:验证部署...
remote:
remote:!推拒到太平洋港25184。
remote:
至https://git.heroku.com/pacific-harbor-25184.git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能将一些文件推送到'https://git.heroku.com/pacific-harbor-25184.git'

如何在部署到heroku时通过此构建错误? (尽管它在本地工作)

解决方案

这与最近的 issue in cloudfoundry (但同样的想法也适用于heroku)

男性肯定,在你的本地项目中,忽略 node_modules first:

  echo'node_modules'>> .gitignore 
git rm -r --cached node_modules
git commit -mignore node_modules

然后再次尝试您的heroku部署。


Here is the error log:

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_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote: 
remote: -----> Installing binaries
remote:        engines.node (package.json):  ~6.11.0
remote:        engines.npm (package.json):   ~5.0.3
remote:        
remote:        Resolving node version ~6.11.0 via semver.io...
remote:        Downloading and installing node 6.11.1...
remote:        Resolving npm version ~5.0.3 via semver.io...
remote:        Downloading and installing npm 5.0.4 (replacing version 
3.10.10)...
remote: 
remote: -----> Restoring cache
remote:        Skipping cache restore (new-signature)
remote: 
remote: -----> Building dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:        npm ERR! path 
/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js
remote:        npm ERR! code ENOENT
remote:        npm ERR! errno -2
remote:        npm ERR! syscall chmod
remote:        npm ERR! enoent ENOENT: no such file or directory, chmod 
'/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js'
remote:        npm ERR! enoent This is related to npm not being able to 
find a file.
remote:        npm ERR! enoent
remote:        
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /app/.npm/_logs/2017-07-16T02_45_14_132Z-
debug.log
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot 
common issues here:
remote:        
remote:        Some possible problems:
remote:        
remote:        - node_modules checked into source control
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 pacific-harbor-25184.
remote: 
To https://git.heroku.com/pacific-harbor-25184.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-harbor-25184.git'

How can I get past this build error when deploying to heroku? (even though it works locally)

解决方案

This is similar to a recent issue in cloudfoundry (but the same idea applies to heroku as well)

Male sure, in your local project, to ignore node_modules first:

echo 'node_modules' >> .gitignore
git rm -r --cached node_modules
git commit -m "ignore node_modules"

Then try your heroku deploy again.

这篇关于未能部署heroku应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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