Heroku雪松节点的应用程序 – 不能推后更新至6.11.1的主人

在将节点服务器更新到版本6.11.1以响应来自Heroku的最新安全更新电子邮件之后,我无法再推我的本地主更改。 更新后服务器和应用程序正常重新启动。

我已经尝试删除并重新安装所有node_modules,提交更改和应用程序在本地运行没有错误,但是当我尝试部署主服务器时,我得到相同的生成失败。 我对package.json文件进行的唯一更改是添加了先前未指定的npm版本。

在安装节点模块时,服务器构build失败:

remote: -----> Building dependencies remote: Installing node modules (package.json) remote: npm ERR! Cannot read property '0' of undefined 

是力推最好/一个好的解决scheme?

这是完整的日志:

 Counting objects: 18, done. Delta compression using up to 8 threads. Compressing objects: 100% (18/18), done. Writing objects: 100% (18/18), 8.80 KiB | 0 bytes/s, done. Total 18 (delta 13), reused 0 (delta 0) 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.1 remote: engines.npm (package.json): 5.3.0 remote: remote: Downloading and installing node 6.11.1... remote: Downloading and installing npm 5.3.0 (replacing version 3.10.10)... remote: remote: -----> Restoring cache remote: Loading 2 from cacheDirectories (default): remote: - node_modules remote: - bower_components (not cached - skipping) remote: remote: -----> Building dependencies remote: Installing node modules (package.json) remote: npm ERR! Cannot read property '0' of undefined remote: remote: npm ERR! A complete log of this run can be found in: remote: npm ERR! /app/.npm/_logs/2017-07-20T22_54_19_003Z-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 app-name. remote: To https://git.heroku.com/app-name.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/app-name.git' 

谢谢。

更新到节点6.11.1和npm 5.3.0后,我得到了相同的错误信息。 heroku的支持build议我运行这些命令:

 heroku plugins:install heroku-repo heroku repo:purge_cache -a APPNAME git commit --allow-empty -m "Purge cache" git push heroku master 

…其中“APPNAME”是我的应用程序的heroku标识符。

这解决了错误 ,我不必恢复到早期版本的NPM。 我已经要求一个解释,但他们还没有回应(刚刚问几分钟前)。

更新2017-07-27: Herkuku的支持回应,并说:“我们仍在为此的根源,但它似乎是相当间歇的。 现在,我已经安装了插件(见上文),我正在运行这些步骤来更新我的应用程序:

 heroku repo:purge_cache -a APPNAME git push heroku master 

这对我来说是可靠的。