所以我试图为Heroku构建一个Node.js应用程序(Hastebin),但它失败了:
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (32/32), done.
Writing objects: 100% (33/33), 61.60 KiB | 0 bytes/s, done.
Total 33 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Reading application state
remote: package.json...
remote: build directory...
remote: cache directory...
remote: environment variables...
remote:
remote: Node engine: 0.8.10
remote: Npm engine: 1.1.49
remote: Start mechanism: Procfile
remote: node_modules source: package.json
remote: node_modules cached: false
remote:
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: Downloading and installing node 0.8.10...
remote: Downloading and installing npm 1.1.49 (replacing version 1.1.62)...
remote: npm ERR! Error: version not found: 1.1.49 : npm/1.1.49
remote: npm ERR! at RegClient.<anonymous> (/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:259:14)
remote: npm ERR! at Request.init.self.callback (/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/lib/node_modules/npm/node_modules/request/main.js:120:22)
remote: npm ERR! at Request.EventEmitter.emit (events.js:96:17)
remote: npm ERR! at Request.<anonymous> (/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/lib/node_modules/npm/node_modules/request/main.js:648:16)
remote: npm ERR! at Request.EventEmitter.emit (events.js:123:20)
remote: npm ERR! at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/lib/node_modules/npm/node_modules/request/main.js:610:14)
remote: npm ERR! at IncomingMessage.EventEmitter.emit (events.js:123:20)
remote: npm ERR! at IncomingMessage._emitEnd (http.js:366:10)
remote: npm ERR! at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
remote: npm ERR! at CleartextStream.socketOnData (http.js:1366:20)
remote: npm ERR! If you need help, you may report this log at:
remote: npm ERR! <http://github.com/isaacs/npm/issues>
remote: npm ERR! or email it to:
remote: npm ERR! <npm-@googlegroups.com>
remote:
remote: npm ERR! System Linux 3.13.0-40-generic
remote: npm ERR! command "/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/bin/node" "/tmp/build_08856eedd22bd2c0d60af50d4929a3ee/.heroku/node/bin/npm" "install" "--unsafe-perm" "--quiet" "-g" "npm@1.1.49"
remote: npm ERR! cwd /app
remote: npm ERR! node -v v0.8.10
remote: npm ERR! npm -v 1.1.62
remote: npm ERR!
remote: npm ERR! Additional logging details can be found in:
remote: npm ERR! /app/npm-debug.log
remote: npm ERR! not ok code 0
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! If you can't find the issue in application code,
remote: please submit a ticket so we can help: https://help.heroku.com/
remote: You can also try reverting to our legacy Node.js buildpack:
remote: heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v63
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to tuxbin.
remote:
To https://git.heroku.com/tuxbin.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/tuxbin.git'
根据事物的外观,似乎存在npm版本的问题。是否有我应该使用的特定版本的npm?
答案 0 :(得分:0)
以下错误很常见:
git push origin master
To https://github.com/Joey-project/project.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Joey-project/project.git'
我被告知发生这种情况的最常见原因是因为不应该将他/她的分支推送到更新的远程分支。
一般来说,必须使用类似的东西:
git fetch origin; git merge origin/master
我建议你也看一下code push to heroku not working,它有很多额外的信息..
答案 1 :(得分:0)
remote:节点引擎:0.8.10 remote:Npm引擎:1.1.49
这些都是node和npm的旧版本。您可能希望将package.json中的版本颠覆为类似于0.10.38(并且只是将npm关闭以使用默认的捆绑版本)?