不可能部署在Heroku上

时间:2019-07-09 20:28:14

标签: node.js git heroku npm nuxt.js

我正在尝试在通用模式下在线在Heroku上部署使用Nuxt.js制作的该应用程序。 我执行的步骤是:“ npm运行构建”和“ npm运行开始”,这些标题在生产模式下都运行良好。

然后:

heroku create
heroku config: set NPM_CONFIG_PRODUCTION = false
heroku config: set HOST = 0.0.0.0
heroku config: set NODE_ENV = production

然后我将其添加到文件“ package.json”中:    heroku-postbuild": "npm run build

我创建了一个具有以下内容的Procfile:web: npm run start

当我这样做时:git push heroku master我遇到了这个错误:

remote:  FATAL  Nuxt Build Error
remote: 
remote:   at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5367:13)
remote:   at processTicksAndRejections (internal/process/task_queues.js:86:5)
remote: 
remote: tput: No value for $TERM and no -T specified
remote: 
remote:    ╭─────────────────────────────╮
remote:    │                             │
remote:    │   ✖ Nuxt Fatal Error        │
remote:    │                             │
remote:    │   Error: Nuxt Build Error   │
remote:    │                             │
remote:    ╰─────────────────────────────╯
remote: 
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! MyMovieApp@1.0.0 build: `nuxt build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the MyMovieApp@1.0.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.CynTY/_logs/2019-07-09T20_01_04_895Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! MyMovieApp@1.0.0 heroku-postbuild: `npm run build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the MyMovieApp@1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.CynTY/_logs/2019-07-09T20_01_04_915Z-debug.log
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        If you're stuck, please submit a ticket so we can help:
remote:        https://help.heroku.com/
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 movie-app-luglio2019.
remote: 
To https://git.heroku.com/movie-app-luglio2019.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/movie-app-luglio2019.git'

remote:  FATAL  Nuxt Build Error
remote: 
remote:   at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5367:13)
remote:   at processTicksAndRejections (internal/process/task_queues.js:86:5)
remote: 
remote: tput: No value for $TERM and no -T specified
remote: 
remote:    ╭─────────────────────────────╮
remote:    │                             │
remote:    │   ✖ Nuxt Fatal Error        │
remote:    │                             │
remote:    │   Error: Nuxt Build Error   │
remote:    │                             │
remote:    ╰─────────────────────────────╯
remote: 
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! MyMovieApp@1.0.0 build: `nuxt build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the MyMovieApp@1.0.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.CynTY/_logs/2019-07-09T20_01_04_895Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! MyMovieApp@1.0.0 heroku-postbuild: `npm run build`
remote: npm ERR! Exit status 1
remote: npm ERR! 
remote: npm ERR! Failed at the MyMovieApp@1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote: 
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR!     /tmp/npmcache.CynTY/_logs/2019-07-09T20_01_04_915Z-debug.log
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        If you're stuck, please submit a ticket so we can help:
remote:        https://help.heroku.com/
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 movie-app-luglio2019.
remote: 
To https://git.heroku.com/movie-app-luglio2019.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/movie-app-luglio2019.git'

1 个答案:

答案 0 :(得分:0)

这里的问题是您没有heroku满意的终端名称或$ TERM。您可以通过在终端仿真器中键入以下内容来确认是否是这种情况:

echo $TERM

如果一切正常,您会得到类似的回信:

xterm-256color

但是我怀疑您会得到“未知”或“未定义”之类的信息。您将需要查看googlepedia以获取有关检查和设置您正在使用的任何终端应用程序的配置的说明。