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

时间:2021-09-10 16:20:19

I was just coding (Meteor JS) when this error started to crop up, and I'm not even sure what caused it:

当这个错误开始出现时,我只是编码(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)   

I've tried to npm cache clear but it hasn't helped. What could be causing this error? Is it my code or is it something else?

我试过npm缓存清除但它没有帮助。可能导致此错误的原因是什么?这是我的代码还是别的什么?

2 个解决方案

#1


2  

I'm in windows 10 and I also get this error after meteor started auto updating.

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

So here's what I did:

所以这就是我做的:

1) I remove dirs node_modules and .meteor/local:

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

rm -rf node_modules
rm -rf .meteor/local 

2) meteor npm install

2)meteor npm install

3) run meteor with: meteor

3)用流星运行流星

UPDATE

After trying the above and running meteor it worked but then after some time it started thworing same error. So I read somewhere to uninstall and install meteor again in Windows and that solved the error. Maybe try unistalling and installing it again if facing this bug

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

#2


0  

Win 10.

I had to reinstall meteor to make it work again.

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

Right after uninstalling you need remove x:/Users/${yourUser}/AppData/Local/.meteor folder. That can require rimraf as described here: Unable to delete node_modules folder (Windows 7)

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

npm install rimraf -g rimraf .meteor

npm安装rimraf -g rimraf .meteor

#1


2  

I'm in windows 10 and I also get this error after meteor started auto updating.

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

So here's what I did:

所以这就是我做的:

1) I remove dirs node_modules and .meteor/local:

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

rm -rf node_modules
rm -rf .meteor/local 

2) meteor npm install

2)meteor npm install

3) run meteor with: meteor

3)用流星运行流星

UPDATE

After trying the above and running meteor it worked but then after some time it started thworing same error. So I read somewhere to uninstall and install meteor again in Windows and that solved the error. Maybe try unistalling and installing it again if facing this bug

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

#2


0  

Win 10.

I had to reinstall meteor to make it work again.

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

Right after uninstalling you need remove x:/Users/${yourUser}/AppData/Local/.meteor folder. That can require rimraf as described here: Unable to delete node_modules folder (Windows 7)

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

npm install rimraf -g rimraf .meteor

npm安装rimraf -g rimraf .meteor