【发布时间】:2015-05-17 09:22:57
【问题描述】:
所以我正在尝试为 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 吗?
【问题讨论】:
-
欢迎来到 SO!您能否直接在问题中向我们展示您的代码?