简体   繁体   English

Heroku上的第二个节点应用程序部署始终失败

[英]Second Node App Deploy on Heroku always Fails

Im experiencing a weird issue with Heroku when deploying. 部署时,我遇到了Heroku的怪异问题。

My second deploy (after committing new github changes and pushing them to my app) always seems to crash with the same error message, however, if I create a new Heroku app and deploy it there, it will always deploy successfully. 我的第二次部署(在提交新的github更改并将其推送到我的应用程序之后)似乎总是因相同的错误消息而崩溃,但是,如果我创建了一个新的Heroku应用程序并将其部署到那里,它将始终成功部署。

This is the error that I receive when the build fails. 这是生成失败时收到的错误。

-----> Node.js app detected
-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 8.x...
       Downloading and installing node 8.9.4...
       Using default npm version: 5.6.0
-----> Restoring cache
       Loading 2 from cacheDirectories (default):
       - node_modules
       - bower_components (not cached - skipping)
-----> Building dependencies
       Installing node modules (package.json + package-lock)
       npm ERR! path /tmp/build_ab6facc2006ab24a04683a1ab7266974/bothello-Bothello-Faq-v2-Demo-e5f231b/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist
       npm ERR! code ENOENT
       npm ERR! errno -2
       npm ERR! syscall rename
       npm ERR! enoent ENOENT: no such file or directory, rename '/tmp/build_ab6facc2006ab24a04683a1ab7266974/bothello-Bothello-Faq-v2-Demo-e5f231b/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist' -> '/tmp/build_ab6facc2006ab24a04683a1ab7266974/bothello-Bothello-Faq-v2-Demo-e5f231b/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/.minimist.DELETE'
       npm ERR! enoent This is related to npm not being able to find a file.
       npm ERR! enoent

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /app/.npm/_logs/2018-01-06T05_06_42_422Z-debug.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - Node version not specified in package.json
       https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed 

Im a bit stuck here on what to do. 我在这里该怎么办。 Any help would be great. 任何帮助都会很棒。

Cheers, J 干杯,J

To anyone interested, I fixed this by disabling the Node Modules Cache via the Heroku CLI: 对于任何感兴趣的人,我通过通过Heroku CLI禁用节点模块缓存来解决此问题:

heroku config:set NODE_MODULES_CACHE=false --app app_name

This has fixed the build issue. 这已解决了构建问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM