![](/img/trans.png)
[英]SIGSEGV from spawn child_process in AWS Lambda function
[英]Error: spawn EACCES in Node AWS Lambda function using child_process to call a binary file
我在基於節點的AWS Lambda函數中具有以下簡化代碼:
import { execFile } from 'child_process';
execFile('./node_modules/webp/bin/dwebp', ['./tmp/file.wepb', '-o',
'./tmp/newFile.png'], (error, stdout, stderr) => {
if (error) throw error;
});
如圖所示,我在node_modules/webp/bin
有一個二進制文件,我用execFile
調用它以將輸出保存在文件夾./tmp/
但出現Error: spawn EACCES
。 可能我沒有被拒絕訪問./tmp/
文件夾,因為我的代碼已成功在其中寫入文件。 我可能只被拒絕訪問命令dwebp
本身。 我不知道該如何處理。 希望能對您有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.