1

抱歉,如果这个问题已经得到解答,但我看不到任何人得到这个错误。

使用工头,我可以看到我的应用程序成功运行,但是在部署到 Heroku 时,我收到以下错误:

Counting objects: 717, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (617/617), done.
Writing objects: 100% (717/717), 3.22 MiB | 305 KiB/s, done.
Total 717 (delta 61), reused 0 (delta 0)
-----> Node.js app detected
-----> Resolving engine versions
   Using Node.js version: 0.6.20
   Using npm version: 1.0.106
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
   express@3.0.6 ./node_modules/express
   â"oâ"?â"? range-parser@0.0.4
   â"oâ"?â"? cookie-signature@0.0.1
   â"oâ"?â"? fresh@0.1.0
   â"oâ"?â"? methods@0.0.1
   â"oâ"?â"? mkdirp@0.3.3
   â"oâ"?â"? cookie@0.0.5
   â"oâ"?â"? debug@0.7.0
   â"oâ"?â"? buffer-crc32@0.1.1
   â"oâ"?â"? commander@0.6.1
   â"oâ"?â"? send@0.1.0 (mime@1.2.6)
   â""â"?â"? connect@2.7.2
   npm ERR! Error: ENOENT, chmod '/tmp/build_2phd1ent7ca7q/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/bin/uglifyjs'
   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-UFfk/bin/node" "/tmp/node-npm-Mvon/cli.js" "rebuild"
   npm ERR! cwd /tmp/build_2phd1ent7ca7q
   npm ERR! node -v v0.6.20
   npm ERR! npm -v 1.0.106
   npm ERR! path /tmp/build_2phd1ent7ca7q/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/bin/uglifyjs
   npm ERR! code ENOENT
   npm ERR!
   npm ERR! Additional logging details can be found in:
   npm ERR!     /tmp/build_2phd1ent7ca7q/npm-debug.log
   npm not ok
 !     Failed to rebuild dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

我想这与 socket.io 依赖关系有关,但我知识渊博,无法确切知道是什么。我创建了一个新的 git 存储库并从另一个存储库复制了它,因为该项目不在该存储库的根目录中,因此无法推送到 heroku,所以也许这与它有关。

任何帮助将不胜感激。

4

1 回答 1

0

您会收到该错误,因为 使用的uglifyjssource-map准确地说)的依赖项之一socketio要求 node 至少为>= 0.8,并且您正在使用0.6.20.

npm info source-map@0.1.7显示了这一点(删除了一些键):

{ name: 'source-map',
  description: 'Generates and consumes source maps',
  'dist-tags': { latest: '0.1.8' },
  versions: 
   [ '0.0.0',
     ...
     '0.1.8' ],
  time: 
   { '0.0.0': '2011-08-30T19:45:40.104Z',
     ...
     '0.1.7': '2012-11-02T19:09:11.172Z',
     '0.1.8': '2012-11-19T22:48:36.067Z' },
  author: 'Nick Fitzgerald <nfitzgerald@mozilla.com>',
  version: '0.1.7',
  homepage: 'https://github.com/mozilla/source-map',
  engines: { node: '>=0.8.0' },
  dist: 
   { shasum: '92da34014a5576d60676150bcf0f55cbd1f395c0',
     tarball: 'http://registry.npmjs.org/source-map/-/source-map-0.1.7.tgz' } }

engineskey可以看出,它至少需要node.js的版本0.8.0

于 2013-01-21T22:42:59.267 回答