python代码执行s local invoke时出错 ERR_INVALID_ARG_TYPE[阿里云函数计算]

其他命令如s deploy, sync和层相关的操作都没有问题,但是执行s local invoke时,报以下错误:

1.10.3: Pulling from aliyunfc/runtime-python3.6 node:internal/streams/writable:315 throw new ERR_INVALID_ARG_TYPE( ^

TypeError [ERR_INVALID_ARG_TYPE]: The “chunk” argument must be of type string or an instance of Buffer or Uint8Array. Received undefined at new NodeError (node:internal/errors:393:5) at _write (node:internal/streams/writable:315:13) at Writable.write (node:internal/streams/writable:337:10) at o (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-core\dist\index.js:223:27) at processLine (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57777:11) at pump (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57766:9) at IncomingMessage.onStreamEvent (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57757:5) at IncomingMessage.emit (node:events:513:28) at IncomingMessage.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10) at HTTPParser.parserOnBody (node:_http_common:129:24) at Socket.socketOnData (node:_http_client:534:22) at Socket.emit (node:events:513:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) { code: ‘ERR_INVALID_ARG_TYPE’ }

Node.js v18.12.1

想咨询下原因是什么 如何解决 谢谢!

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
=====这是一个广告位,招租中,联系qq 78315851====
2 条回复 A 作者 M 管理员
  1. 这是由于Python代码中的输出类型不正确导致的,可能是输出的类型不是字符串或Buffer或Uint8Array,请检查Python代码中的输出类型是否正确。

  2. chunk”参数的类型必须为string或Buffer或Uint8Array的实例,chunk参数现在可以是Uint8Array实例。 参数 chunk