RangeError:无效的数组缓冲区长度 - Meteor JS

时间:2016-08-12 00:50:14

标签: javascript node.js mongodb meteor npm

当这个错误开始出现时,我只是编码(Meteor JS),我甚至不确定是什么导致它:

buffer.js:25                                                                      
const ui8 = new Uint8Array(size);                                             
            ^
RangeError: Invalid array buffer length                                           
at new ArrayBuffer (native)                                                   
at new Uint8Array (native)                                                    
at createBuffer (buffer.js:25:17)                                             
at allocate (buffer.js:96:12)                                                 
at new Buffer (buffer.js:56:12)                                               
at increaseBufferIfNecessary (C:\Users\admin\AppData\Local\.meteor\packages\meteor-tool\1.4.0-1\mtos.windows.x86_32\dev_bundle\lib\node_modules\stream-buffers\lib\writable_streambuffer.js:58:23)                                               
at [object Object]._write (C:\Users\admin\AppData\Local\.meteor\packages\meteor-tool\1.4.0-1\mtos.windows.x86_32\dev_bundle\lib\node_modules\streambuffers\lib\writable_streambuffer.js:65:5)                                                   
at doWrite (_stream_writable.js:300:12)                                       
at writeOrBuffer (_stream_writable.js:286:5)                                  
at [object Object].Writable.write (_stream_writable.js:214:11)                
at Request.ondata (stream.js:31:26)                                           
at emitOne (events.js:82:20)                                                  
at Request.emit (events.js:169:7)                                             
at IncomingMessage.<anonymous
(C:\Users\admin\AppData\Local\.meteor\packages\meteor-tool\1.4.0-1\mtos.windows.x86_32\dev_bundle\lib\node_modules\request\request.js:1255:12)                                                                    
at emitOne (events.js:77:13)                                                  
at IncomingMessage.emit (events.js:169:7)                                     
at readableAddChunk (_stream_readable.js:153:18)                              
at IncomingMessage.Readable.push (_stream_readable.js:111:10)                 
at HTTPParser.parserOnBody (_http_common.js:124:22)                           
at TLSSocket.socketOnData (_http_client.js:320:20)                            
at emitOne (events.js:77:13)                                                  
at TLSSocket.emit (events.js:169:7)                                           
at readableAddChunk (_stream_readable.js:153:18)                              
at TLSSocket.Readable.push (_stream_readable.js:111:10)                       
at TLSWrap.onread (net.js:536:20)   

我试过npm cache clear,但没有帮助。可能导致此错误的原因是什么?这是我的代码还是别的什么?

2 个答案:

答案 0 :(得分:2)

我在Windows 10中,并且在流星开始自动更新后我也收到此错误。

所以这就是我所做的:

1)我删除了dirs node_modules和.meteor / local:

rm -rf node_modules
rm -rf .meteor/local 

2)meteor npm install

3)使用meteor

运行流星

更新

在尝试上面并运行流星之后,它工作了但是过了一段时间后它开始出现同样的错误。所以我在某处阅读了卸载并在Windows中再次安装meteor并解决了错误。如果遇到这个错误,可以尝试unistalling并再次安装

答案 1 :(得分:0)

赢10。

我不得不重新安装meteor以使其再次运行。

卸载后,您需要删除x:/Users/${yourUser}/AppData/Local/.meteor文件夹。这可能需要如下所述的rimraf:Unable to delete node_modules folder (Windows 7)

npm install rimraf -g rimraf .meteor