Node.js 推送失败![远程拒绝]主机->;主控(预接收)
我在将NodeJS应用程序部署到Heroku时遇到问题。 这就是错误:Node.js 推送失败![远程拒绝]主机->;主控(预接收),node.js,git,heroku,npm,Node.js,Git,Heroku,Npm,我在将NodeJS应用程序部署到Heroku时遇到问题。 这就是错误: remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NPM_CONFIG_PR
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): 5.3.0
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 5.3.0...
remote: Downloading and installing node 5.3.0...
remote: Detected package-lock.json: defaulting npm to version 5.x.x
remote: Bootstrapping npm 5.x.x (replacing 3.3.12)...
remote: npm 5.5.1 installed
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote: npm ERR! Buffer.alloc is not a function
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /app/.npm/_logs/2017-10-21T22_24_56_159Z-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 young-ridge-96999.
remote:
To https://git.heroku.com/young-ridge-96999.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/young-ridge-96999.git
我尝试了其他堆栈溢出问题的建议:
应用程序的.gitignore
具有节点\u模块/
package.json已被删除
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
我试着做一个新的分支,并用新的分支向Heroku推进
及
谢谢很可能是因为您使用了旧版本的Node。您可以使用安装最新版本。在package.json中指定您在本地使用的npm的确切版本(
npm--version
)也会有所帮助,但我建议升级到Node的最新版本。这很可能是因为您使用了旧版本的Node。您可以使用安装最新版本。在package.json中指定您在本地使用的npm的确切版本(npm--version
)也会有所帮助,但我建议升级到Node的最新版本。的可能副本
git add .
git commit -a -m'comment'
git push