【问题标题】:Failed to Deploy to Heroku: npm ERR! Error: version not found: 1.1.49 : npm/1.1.49无法部署到 Heroku:npm ERR!错误:找不到版本:1.1.49:npm/1.1.49
【发布时间】: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!您能否直接在问题中向我们展示您的代码?

标签: node.js git heroku


【解决方案1】:

以下错误很常见:

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,它有很多额外的信息..

【讨论】:

    【解决方案2】:

    远程:节点引擎:0.8.10 远程:Npm 引擎:1.1.49

    这些都是非常旧的 node 和 npm 版本。您可能希望将 package.json 中的版本提高到 0.10.38 之类的东西(并且只关闭 npm 以使用默认的捆绑版本)?

    【讨论】:

      猜你喜欢
      • 2019-01-22
      • 1970-01-01
      • 1970-01-01
      • 2017-11-03
      • 1970-01-01
      • 2023-02-10
      • 1970-01-01
      • 2017-10-21
      • 2020-09-27
      相关资源
      最近更新 更多