npm模块安装不断中止

npm module installation constantly aborting

我遇到了 npm 模块安装问题。 每次我尝试安装新模块时,安装过程都会崩溃并因此中止。 我的 npm 版本是 1.4.28,node 版本是 0.10.35,在 debian wheezy 上运行。我尝试安装一对(yo、bower、grunt、closurecompiler),同样的问题仍然存在。请参阅下面的示例安装尝试

npm install closurecompiler -g

以上将以下内容溢出到终端

==== Stack trace ============================================

Security context: 0x25834659 <JS Object>#0#
    1: _parse(aka parse) [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extended-header.js:~61] (this=0x38fada59 <an ExtendedHeader>#1#,c=0x38fb05c5 <a Buffer>#2#)
    2: emit [events.js:~53] (this=0x38fada59 <an ExtendedHeader>#1#,type=0x51614861 <String[4]: data>)
    3: arguments adaptor frame: 2->1
    4: _read [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:111] (this=0x38fada59 <an ExtendedHeader>#1#)
    8: _read [native v8natives.js:1594] (this=0x38fada59 <an ExtendedHeader>#1#)
    9: write [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:~50] (this=0x38fada59 <an ExtendedHeader>#1#,c=0x38fb05c5 <a Buffer>#2#)
   10: _process [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:105] (this=0x38f3afc9 <an Extract>#3#,c=0x38fb05c5 <a Buffer>#2#)
   11: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:~46] (this=0x38f430c1 <a BlockStream>#4#,c=0x38fb05c5 <a Buffer>#2#)
   12: emit [events.js:~53] (this=0x38f430c1 <a BlockStream>#4#,type=0x51614861 <String[4]: data>)
   13: arguments adaptor frame: 2->1
   14: _emitChunk [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:145] (this=0x38f430c1 <a BlockStream>#4#,flush=0x25808091 <undefined>)
   15: arguments adaptor frame: 0->1
   16: resume [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:~55] (this=0x38f430c1 <a BlockStream>#4#)   17: arguments adaptor frame: 1->0
   18: resume [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/reader.js:~251] (this=0x38f3afc9 <an Extract>#3#,who=0x25808091 <undefined>)
   19: arguments adaptor frame: 0->1
   20: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extract.js:57] (this=0x38f43109 <a DirWriter>#5#)
   21: emit [events.js:~53] (this=0x38f43109 <a DirWriter>#5#,type=0x3334f785 <String[5]: ready>)
   22: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:39] (this=0x25834701 <JS Global Object>#6#,er=0x25808081 <null>)
   23: arguments adaptor frame: 2->1
   24: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:29] (this=0x25834701 <JS Global Object>#6#,er=0x25808081 <null>)
   26: oncomplete [fs.js:108] (this=0x38f94099 <an Object>#7#)
   27: arguments adaptor frame: 1->0

==== Details ================================================

[1]: _parse(aka parse) [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extended-header.js:~61] (this=0x38fada59 <an ExtendedHeader>#1#,c=0x38fb05c5 <a Buffer>#2#) {
  // stack-allocated locals
  var i = 411
  var l = 512
  var b = 68
  var val = 0x38fb17ad <String[5]: 2.4.x>
  // expression stack (top to bottom)
  [05] : 0
  [04] : 2113118
--------- s o u r c e   c o d e ---------
function parse(c) {?  if (this._state === ERR) return??  for ( var i = 0, l = c.length?      ; i < l?      ; this._position++, this._fieldPos++, i++) {?    // console.error("top of loop, size="+this._size)??    var b = c[i]??    if (this._size >= 0 && this._fieldPos > this._size) {?      error(this, "field exceed...

-----------------------------------------
}

[2]: emit [events.js:~53] (this=0x38fada59 <an ExtendedHeader>#1#,type=0x51614861 <String[4]: data>) {
// optimized frame
}
[3]: arguments adaptor frame: 2->1 {
  // actual arguments
  [00] : 0x51614861 <String[4]: data>
  [01] : 0x38fb05c5 <a Buffer>#2#  // not passed to callee
}

[4]: _read [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:111] (this=0x38fada59 <an ExtendedHeader>#1#) {
  // stack-allocated locals
  var chunk = 0x38fb05c5 <a Buffer>#2#
  var mql = 0x25808091 <undefined>
  // expression stack (top to bottom)
  [04] : 0x38fb05c5 <a Buffer>#2#
  [03] : 0x51614861 <String[4]: data>
  [02] : 0x38fada59 <an ExtendedHeader>#1#
--------- s o u r c e   c o d e ---------
function () {?  // console.error("    Tar Entry _read", this.path)??  if (this._paused || this._reading || this._ended) return??  // set this flag so that event handlers don't inadvertently?  // get multiple _read() calls running.?  this._reading = true??  // have any data to emit??  while (this._index < thi...

-----------------------------------------
}

[8]: _read [native v8natives.js:1594] (this=0x38fada59 <an ExtendedHeader>#1#) {
  // stack-allocated locals
  var arguments = 0x38fb0651 <an Arguments>#8#
  var c = 0x38fb0661 <JS Array[2]>#9#
  var d = 0
  var e = 0x25808091 <undefined>
  var f = 0x25808091 <undefined>
  var g = 0x25808091 <undefined>
  var h = 0x25808091 <undefined>
  // expression stack (top to bottom)
  [11] : 0
  [10] : 2
  [09] : 0x38fb0661 <JS Array[2]>#9#
  [08] : 0x38fada59 <an ExtendedHeader>#1#
  [07] : 0x41cb91f5 <JS Function>#10#
--------- s o u r c e   c o d e ---------
function (){??"use strict";???if(%_IsConstructCall()){?return %NewObjectFromBound(b);?}?var c=%BoundFunctionGetBindings(b);??var d=%_ArgumentsLength();?if(d==0){?return %Apply(c[0],c[1],c,2,c.length-2);?}?if(c.length===2){?return %Apply(c[0],c[1],arguments,0,d);?}?var e=c.length-2;?var f=new InternalArray(e+...

-----------------------------------------
}

[9]: write [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:~50] (this=0x38fada59 <an ExtendedHeader>#1#,c=0x38fb05c5 <a Buffer>#2#) {
// optimized frame
}
[10]: _process [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:105] (this=0x38f3afc9 <an Extract>#3#,c=0x38fb05c5 <a Buffer>#2#) {
  // stack-allocated locals
  var entry = 0x38fada59 <an ExtendedHeader>#1#
  var zero = 0x25808091 <undefined>
  var i = 0x25808091 <undefined>
  // expression stack (top to bottom)
  [04] : 0x38fb05c5 <a Buffer>#2#
  [03] : 0x38fada59 <an ExtendedHeader>#1#
--------- s o u r c e   c o d e ---------
function (c) {?  assert(c && c.length === 512, "block size should be 512")??  // one of three cases.?  // 1. A new header?  // 2. A part of a file/extended header?  // 3. One of two or more EOF null blocks??  if (this._entry) {?    var entry = this._entry?    entry.write(c)?    if (entry._remaining === 0) {?...

-----------------------------------------
}

[11]: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:~46] (this=0x38f430c1 <a BlockStream>#4#,c=0x38fb05c5 <a Buffer>#2#) {
// optimized frame
}
[12]: emit [events.js:~53] (this=0x38f430c1 <a BlockStream>#4#,type=0x51614861 <String[4]: data>) {
// optimized frame
}
[13]: arguments adaptor frame: 2->1 {
  // actual arguments
  [00] : 0x51614861 <String[4]: data>
  [01] : 0x38fb05c5 <a Buffer>#2#  // not passed to callee
}

[14]: _emitChunk [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:145] (this=0x38f430c1 <a BlockStream>#4#,flush=0x25808091 <undefined>) {
  // stack-allocated locals
  var padBytes = 0x25808091 <undefined>
  var bufferIndex = 0
  var out = 0x38fb05c5 <a Buffer>#2#
  var outOffset = 0
  var outHas = 0
  var cur = 0x38f556bd <a Buffer>#11#
  var curHas = 15360
  var l = 0x25808091 <undefined>
  var i = 0x25808091 <undefined>
  // expression stack (top to bottom)
  [11] : 0x38fb05c5 <a Buffer>#2#
  [10] : 0x51614861 <String[4]: data>
  [09] : 0x38f430c1 <a BlockStream>#4#
--------- s o u r c e   c o d e ---------
function (flush) {?  // debug("emitChunk flush=%j emitting=%j paused=%j", flush, this._emitting, this._paused)??  // emit a <chunkSize> chunk?  if (flush && this._zeroes) {?    // debug("    BS push zeroes", this._bufferLength)?    // push a chunk of zeroes?    var padBytes = (this._bufferLength % this._chun...

-----------------------------------------
}

[15]: arguments adaptor frame: 0->1 {
}

[16]: resume [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:~55] (this=0x38f430c1 <a BlockStream>#4#) {
// optimized frame
}
[17]: arguments adaptor frame: 1->0 {
  // actual arguments
  [00] : 0x38f3afc9 <an Extract>#3#  // not passed to callee
}

[18]: resume [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/reader.js:~251] (this=0x38f3afc9 <an Extract>#3#,who=0x25808091 <undefined>) {
// optimized frame
}
[19]: arguments adaptor frame: 0->1 {
}

[20]: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extract.js:57] (this=0x38f43109 <a DirWriter>#5#) {
  // expression stack (top to bottom)
  [00] : 0x38f3afc9 <an Extract>#3#
--------- s o u r c e   c o d e ---------
function () {?    me.pipe(me._fst, { end: false })?    me.resume()?  }
-----------------------------------------
}

[21]: emit [events.js:~53] (this=0x38f43109 <a DirWriter>#5#,type=0x3334f785 <String[5]: ready>) {
// optimized frame
}
[22]: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:39] (this=0x25834701 <JS Global Object>#6#,er=0x25808081 <null>) {
  // expression stack (top to bottom)
  [01] : 0x3334f785 <String[5]: ready>
  [00] : 0x38f43109 <a DirWriter>#5#
--------- s o u r c e   c o d e ---------
function (er) {?    if (er) return me.error(er)?    // ready to start getting entries!?    me.ready = true?    me.emit("ready")?    me._process()?  }
-----------------------------------------
}

[23]: arguments adaptor frame: 2->1 {
  // actual arguments
  [00] : 0x25808081 <null>
  [01] : 0x38f93f31 <String[86]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules/underscore>  // not passed to callee
}

[24]: /* anonymous */ [/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:29] (this=0x25834701 <JS Global Object>#6#,er=0x25808081 <null>) {
  // heap-allocated locals
  var er = 0x25808081 <null>
  // expression stack (top to bottom)
  [03] : 0x38f93f31 <String[86]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules/underscore>
  [02] : 0x25808081 <null>
  [01] : 0x25834701 <JS Global Object>#6#
  [00] : 0x38f93a91 <JS Function>#12#
--------- s o u r c e   c o d e ---------
function (er) {?        if (!er) {?            made = made || p;?            return cb(null, made);?        }?        switch (er.code) {?            case 'ENOENT':?                mkdirP(path.dirname(p), opts, function (er, made) {?                    if (er) cb(er, made);?                    else mkdirP(p, ...

-----------------------------------------
}

[26]: oncomplete [fs.js:108] (this=0x38f94099 <an Object>#7#) {
  // stack-allocated locals
  var arguments = 0x38fabf71 <an Arguments>#13#
  // expression stack (top to bottom)
  [03] : 0x38fabf71 <an Arguments>#13#
  [02] : 0x25808081 <null>
  [01] : 0x38f93f45 <JS Function>#14#
--------- s o u r c e   c o d e ---------
function () {?    return cb.apply(null, arguments);?  }
-----------------------------------------
}

[27]: arguments adaptor frame: 1->0 {
  // actual arguments
  [00] : 0x25808081 <null>  // not passed to callee
}

==== Key         ============================================

#0# 0x25834659: 0x25834659 <JS Object>
#1# 0x38fada59: 0x38fada59 <an ExtendedHeader>
            domain: 0x25808081 <null>
           _events: 0x38fadb01 <an Object>#15#
     _maxListeners: 10
          readable: 0x258080b1 <true>
          writable: 0x258080b1 <true>
        _needDrain: 0x258080c1 <false>
           _paused: 0x258080c1 <false>
          _reading: 0x258080b1 <true>
           _ending: 0x258080c1 <false>
            _ended: 0x258080c1 <false>
        _remaining: 653
            _queue: 0x38fadb9d <JS Array[1]>#16#
            _index: 1
         _queueLen: 1
             _read: 0x38fadc09 <JS Function>#17#
             props: 0x38fadca9 <an Object>#18#
           _header: 0x38fac43d <a TarHeader>#19#
         _extended: 0x38fadcd5 <an Object>#20#
           _global: 0x38fadd05 <an Object>#21#
              type: 0x3334ee95 <String[14]: ExtendedHeader>
              path: 0x38fac5c9 <String[30]: PaxHeader/package/package.json>
              size: 1677
            fields: 0x38fae435 <an Object>#22#
         _position: 923
         _fieldPos: 6
            _state: 1
          _sizeBuf: 0x38fae4b5 <JS Array[0]>#23#
           _keyBuf: 0x38fae50d <JS Array[3]>#24#
           _valBuf: 0x38fae52d <JS Array[0]>#25#
             _size: 95
              _key: 0x38fb16f5 <String[41]: NODETAR.package.devDependencies.uglify-js>
              meta: 0x258080b1 <true>
#2# 0x38fb05c5: 0x38fb05c5 <a Buffer>
            length: 512
            parent: 0x38f60e09 <a SlowBuffer>#26#
            offset: 1024
#3# 0x38f3afc9: 0x38f3afc9 <an Extract>
            domain: 0x25808081 <null>
           _events: 0x38f430b5 <an Object>#27#
     _maxListeners: 10
          writable: 0x258080b1 <true>
          readable: 0x258080b1 <true>
           _stream: 0x38f430c1 <a BlockStream>#4#
          position: 1024
            _ended: 0x258080c1 <false>
              _fst: 0x38f43109 <a DirWriter>#5#
           _paused: 0x258080c1 <false>
       _eofStarted: 0x258080c1 <false>
            _entry: 0x38fada59 <an ExtendedHeader>#1#
#4# 0x38f430c1: 0x38f430c1 <a BlockStream>
          readable: 0x258080b1 <true>
          writable: 0x258080b1 <true>
              _opt: 0x38f4d331 <an Object>#28#
        _chunkSize: 512
           _offset: 1536
           _buffer: 0x38f4d33d <JS Array[1]>#29#
     _bufferLength: 14848
           _zeroes: 0x38f4d34d <a Buffer>#30#
           _events: 0x38f4d365 <an Object>#31#
           _paused: 0x258080c1 <false>
        _needDrain: 0x258080b1 <true>
         _emitting: 0x258080b1 <true>
#5# 0x38f43109: 0x38f43109 <a DirWriter>
            domain: 0x25808081 <null>
           _events: 0x38f4d3a9 <an Object>#32#
     _maxListeners: 10
              type: 0x3334e6ed <String[9]: Directory>
             props: 0x38f297e1 <an Object>#33#
             depth: 0
           clobber: 0x258080b1 <true>
            parent: 0x25808081 <null>
              root: 0x38f43109 <a DirWriter>#5#
              path: 0x38f4d3b5 <String[86]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules/underscore>
             _path: 0x38f4d3b5 <String[86]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules/underscore>
          basename: 0x38f51b0d <String[10]: underscore>
           dirname: 0x38f51b2d <String[75]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules>
          linkpath: 0x25808081 <null>
              size: 0x25808091 <undefined>
          readable: 0x258080c1 <false>
          writable: 0x258080b1 <true>
           _buffer: 0x38f51b41 <JS Array[0]>#34#
             ready: 0x258080b1 <true>
            filter: 0x253df285 <JS Function>#35#
          _madeDir: 0x25808081 <null>
#6# 0x25834701: 0x25834701 <JS Global Object>
#7# 0x38f94099: 0x38f94099 <an Object>
            domain: 0x25808081 <null>
        oncomplete: 0x38f93f85 <JS Function>#36#
#8# 0x38fb0651: 0x38fb0651 <an Arguments>
            length: 0
#9# 0x38fb0661: 0x38fb0661 <JS Array[2]>
                 0: 0x41cb91f5 <JS Function>#10#
                 1: 0x38fada59 <an ExtendedHeader>#1#
#10# 0x41cb91f5: 0x41cb91f5 <JS Function>
#11# 0x38f556bd: 0x38f556bd <a Buffer>
            length: 16384
            parent: 0x38f60e09 <a SlowBuffer>#26#
            offset: 0
#12# 0x38f93a91: 0x38f93a91 <JS Function>
#13# 0x38fabf71: 0x38fabf71 <an Arguments>
            length: 1
            callee: 0x38f93f85 <JS Function>#36#
#14# 0x38f93f45: 0x38f93f45 <JS Function>
#15# 0x38fadb01: 0x38fadb01 <an Object>
              data: 0x2d575f75 <JS Function parse>#37#
               end: 0x38fada35 <JS Function>#38#
             pause: 0x38fae5c1 <JS Function>#39#
#16# 0x38fadb9d: 0x38fadb9d <JS Array[1]>
                 0: 0x38fb05c5 <a Buffer>#2#
#17# 0x38fadc09: 0x38fadc09 <JS Function>
            length: 0
#18# 0x38fadca9: 0x38fadca9 <an Object>
#19# 0x38fac43d: 0x38fac43d <a TarHeader>
             block: 0x38fac3d9 <a Buffer>#40#
        cksumValid: 0x258080b1 <true>
              path: 0x38fac5c9 <String[30]: PaxHeader/package/package.json>
              mode: 420
               uid: 0x38fad001 <Number: 1916975748>
               gid: 0x38fad139 <Number: 1700319516>
              size: 1677
             mtime: 0x38fad265 <Number: 1392064404>
             cksum: 7170
              type: 0x51615be5 <String[1]: x>
          linkpath: 0x5160812d <String[0]: >
             ustar: 0x38fad48d <String[6]\: ustar\x00>
          ustarver: 0x38fad4d5 <String[2]: 00>
             uname: 0x5160812d <String[0]: >
             gname: 0x5160812d <String[0]: >
            devmaj: 0
            devmin: 0
              fill: 0x5160812d <String[0]: >
#20# 0x38fadcd5: 0x38fadcd5 <an Object>
#21# 0x38fadd05: 0x38fadd05 <an Object>
#22# 0x38fae435: 0x38fae435 <an Object>
#23# 0x38fae4b5: 0x38fae4b5 <JS Array[0]>
#24# 0x38fae50d: 0x38fae50d <JS Array[3]>
                 0: 78
                 1: 79
                 2: 68
#25# 0x38fae52d: 0x38fae52d <JS Array[0]>
#26# 0x38f60e09: 0x38f60e09 <a SlowBuffer>
            length: 16384
#27# 0x38f430b5: 0x38f430b5 <an Object>
             entry: 0x38f519f9 <JS Array[3]>#41#
            unpipe: 0x38f51a09 <JS Function onunpipe>#42#
             drain: 0x38f51a2d <JS Function>#43#
             error: 0x38f51a51 <JS Array[3]>#44#
             close: 0x38f51a61 <JS Array[3]>#45#
            finish: 0x38f51a71 <JS Function g>#46#
              data: 0x38fac10d <JS Function ondata>#47#
               end: 0x38fac1c1 <JS Function cleanup>#48#
#28# 0x38f4d331: 0x38f4d331 <an Object>
#29# 0x38f4d33d: 0x38f4d33d <JS Array[1]>
                 0: 0x38f556bd <a Buffer>#11#
#30# 0x38f4d34d: 0x38f4d34d <a Buffer>
            length: 512
            parent: 0x38f08845 <a SlowBuffer>#49#
            offset: 2560
#31# 0x38f4d365: 0x38f4d365 <an Object>
             error: 0x38f556d5 <JS Function>#50#
              data: 0x38f556f9 <JS Function>#51#
               end: 0x38f5571d <JS Function>#52#
             drain: 0x38f55741 <JS Function>#53#
#32# 0x38f4d3a9: 0x38f4d3a9 <an Object>
             ready: 0x38f55779 <JS Function>#54#
             error: 0x38fac289 <JS Array[2]>#55#
             drain: 0x38fac211 <JS Array[2]>#56#
             close: 0x38fac381 <JS Array[2]>#57#
#33# 0x38f297e1: 0x38f297e1 <an Object>
              type: 0x3334e6ed <String[9]: Directory>
              path: 0x38f2898d <String[86]: /usr/local/lib/node_modules/closurecompiler/node_modules/jsdoc/node_modules/underscore>
             strip: 1
               uid: 5000
               gid: 5000
            filter: 0x253df285 <JS Function>#35#
         Directory: 0x258080b1 <true>
              root: 0x25808081 <null>
            parent: 0x25808081 <null>
#34# 0x38f51b41: 0x38f51b41 <JS Array[0]>
#35# 0x253df285: 0x253df285 <JS Function>
#36# 0x38f93f85: 0x38f93f85 <JS Function>
#37# 0x2d575f75: 0x2d575f75 <JS Function parse>
#38# 0x38fada35: 0x38fada35 <JS Function>
#39# 0x38fae5c1: 0x38fae5c1 <JS Function>
#40# 0x38fac3d9: 0x38fac3d9 <a Buffer>
            length: 512
            parent: 0x38f60e09 <a SlowBuffer>#26#
            offset: 0
#41# 0x38f519f9: 0x38f519f9 <JS Array[3]>
                 0: 0x38f60cb9 <JS Function>#58#
                 1: 0x38f297bd <JS Function extractEntry>#59#
                 2: 0x38fac055 <JS Function>#60#
#42# 0x38f51a09: 0x38f51a09 <JS Function onunpipe>
#43# 0x38f51a2d: 0x38f51a2d <JS Function>
#44# 0x38f51a51: 0x38f51a51 <JS Array[3]>
                 0: 0x38f60d25 <JS Function onerror>#61#
                 1: 0x38f60db5 <JS Function>#62#
                 2: 0x38fac19d <JS Function onerror>#63#
#45# 0x38f51a61: 0x38f51a61 <JS Array[3]>
                 0: 0x38f60dd9 <JS Function g>#64#
                 1: 0x38f29749 <JS Function cb>#65#
                 2: 0x38fac1c1 <JS Function cleanup>#48#
#46# 0x38f51a71: 0x38f51a71 <JS Function g>
          listener: 0x38f60d6d <JS Function onfinish>#66#
#47# 0x38fac10d: 0x38fac10d <JS Function ondata>
#48# 0x38fac1c1: 0x38fac1c1 <JS Function cleanup>
#49# 0x38f08845: 0x38f08845 <a SlowBuffer>
            length: 8192
              used: 5248
#50# 0x38f556d5: 0x38f556d5 <JS Function>
#51# 0x38f556f9: 0x38f556f9 <JS Function>
#52# 0x38f5571d: 0x38f5571d <JS Function>
#53# 0x38f55741: 0x38f55741 <JS Function>
#54# 0x38f55779: 0x38f55779 <JS Function>
#55# 0x38fac289: 0x38fac289 <JS Array[2]>
                 0: 0x38f5579d <JS Function>#67#
                 1: 0x38fac19d <JS Function onerror>#63#
#56# 0x38fac211: 0x38fac211 <JS Array[2]>
                 0: 0x38f557c1 <JS Function>#68#
                 1: 0x38fac131 <JS Function ondrain>#69#
#57# 0x38fac381: 0x38fac381 <JS Array[2]>
                 0: 0x38f557e5 <JS Function>#70#
                 1: 0x38fac1c1 <JS Function cleanup>#48#
#58# 0x38f60cb9: 0x38f60cb9 <JS Function>
#59# 0x38f297bd: 0x38f297bd <JS Function extractEntry>
#60# 0x38fac055: 0x38fac055 <JS Function>
#61# 0x38f60d25: 0x38f60d25 <JS Function onerror>
#62# 0x38f60db5: 0x38f60db5 <JS Function>
#63# 0x38fac19d: 0x38fac19d <JS Function onerror>
#64# 0x38f60dd9: 0x38f60dd9 <JS Function g>
          listener: 0x38f60d49 <JS Function onclose>#71#
#65# 0x38f29749: 0x38f29749 <JS Function cb>
#66# 0x38f60d6d: 0x38f60d6d <JS Function onfinish>
#67# 0x38f5579d: 0x38f5579d <JS Function>
#68# 0x38f557c1: 0x38f557c1 <JS Function>
#69# 0x38fac131: 0x38fac131 <JS Function ondrain>
#70# 0x38f557e5: 0x38f557e5 <JS Function>
#71# 0x38f60d49: 0x38f60d49 <JS Function onclose>
=====================

Aborted
[  7.14 ######### ] ~ $

即使清除缓存 (npm cache clean 并更改 npm 使用的所有文件夹的所有权),问题仍然存在。

我最初的猜测可能是节点未能正确解析接收到的 json 数据,但我所做的所有努力似乎都没有成功。

这看起来像是解析 package.json 文件时的失败,当然,但即便如此也不应导致终止带有堆栈跟踪的 node 进程。您能排除硬件(例如内存)问题吗?

能否请您上传您的 npm-debug.log 作为要点 http://gist.github.com?如果可能,运行 npm 至少有一个 -d 标志来提高日志记录级别。

自 1.4.28 以来,npm 有了很多改进——尤其是在安装期间的冲突和竞争条件方面。您可以尝试更新您的 npm 安装吗?

要更新 npm,运行 npm -g install npm@latest

对于某些Linux发行版(Debian/Ubuntu和RedHat/CentOS),发行版提供的最新节点版本可能落后于稳定版本。 Here are instructions from NodeSource 关于获取最新节点。

谢谢!

再次感谢 smikes。

我尝试了这个建议,但无法让它发挥作用,所以我最终再次从源代码构建。我的初始构建基于 v0.10.35,所以我决定检查 repo 是否有为 arm 预构建的 nodejs 版本。截至目前,nodejs 的最新版本是 v0.11.14,但是为 arm 预构建二进制文件的版本是 v0.11.12

然后我决定使用 v0.11.12,希望如果它为 arm-pi 成功编译它可能对我有用。我下载了 source 并解压了它。

为了让生活更轻松一点并最终避免每次使用 nodenpmsudoing,我创建了一个像这样的 shebang (build.sh) 并保存在提取文件的根目录中。由于我的体系结构是基于 arm 的(版本 7),因此我使用标志来适当地指导我的 g++ 和 gcc。

#!/bin/bash
export CFLAGS='-march=armv7-a'
export CXXFLAGS='-march=armv7-a'
./configure --prefix=$HOME/local/nodejs
make install

然后我使 build.sh 文件可执行

sudo chmod a+x build.sh

通过执行 build.sh 文件

安装成功(尽管构建花了几个小时)
./build.sh

然后我将 NODE_PATH 导出到我的 ~/.bashrc 配置文件,就像这样..

nano ~/.bashrc
export NODE=$HOME/local/nodejs
export NODE_PATH=$NODE/lib/node_modules
export PATH=$NODE/bin:$PATH

快速启用配置

source ~/.bashrc

然后测试安装

node -v

v0.11.12

npm -v

1.4.3

终于更新 npm

npm -g install npm@latest
npm -v

2.1.18