为什么不是从Heroku发现的NPM中可以获得的节点模块?

时间:2013-01-02 15:22:43

标签: node.js heroku npm

在当地,我可以跑:

npm install oscar@0.2.0

要安装此软件包:https://npmjs.org/package/oscar

您可以在该页面上看到当前版本为0.2.0。

然而,当我的package.json包含:

"dependencies": {
  "oscar": "~0.2.0",
  //...
}

...我推到Heroku,我收到了这个回复:

-----> Installing dependencies with npm
       npm ERR! Error: No compatible version found: oscar@'>=0.2.0- <0.3.0-'
       npm ERR! Valid install targets:
       npm ERR! ["0.1.0","0.1.1","0.1.2"]
       npm ERR!     at installTargetsError (/tmp/node-npm-Sezl/lib/cache.js:424:10)
       npm ERR!     at /tmp/node-npm-Sezl/lib/cache.js:406:17
       npm ERR!     at saved (/tmp/node-npm-Sezl/lib/utils/npm-registry-client/get.js:136:7)
       npm ERR!     at cb (/tmp/node-npm-Sezl/node_modules/graceful-fs/graceful-fs.js:36:9)
       npm ERR! Report this *entire* log at:
       npm ERR!     <http://github.com/isaacs/npm/issues>
       npm ERR! or email it to:
       npm ERR!     <npm-@googlegroups.com>
       npm ERR! 
       npm ERR! System Linux 2.6.32-348-ec2
       npm ERR! command "/tmp/node-node-yaOa/bin/node" "/tmp/node-npm-Sezl/cli.js" "install" "--production"
       npm ERR! cwd /tmp/build_13f8kjrsns2wh
       npm ERR! node -v v0.4.7
       npm ERR! npm -v 1.0.106
       npm ERR! 
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_13f8kjrsns2wh/npm-debug.log
       npm not ok
 !     Failed to install --production dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

To git@heroku.com:xxxxx-xxxxxx-nnnn.git
 ! [remote rejected] master -> master (pre-receive hook declined)

如果它有任何方位,这里是我的package.json为Heroku指定的节点+ npm版本:

"engines": {
  "node": "0.8.x",
  "npm":  "1.1.x"
},

我做错了什么?为什么不提供此套餐的最新版本?

1 个答案:

答案 0 :(得分:0)

哎呀,答案结果是我的问题的最后一个代码样本还没有提交,所以Heroku仍在使用旧版本的NPM和Node。提交阻止并重新推送修复它。