在 Amplify Push 上获得 "Packaging lambda failed function failed. Could not find npm executable in the PATH." 但 NPM 在路径中

On Amplify Push getting "Packaging lambda failed function failed. Could not find npm executable in the PATH." but NPM is in path

当我放大推送时出现错误“打包 lambda 失败函数失败。无法在 PATH 中找到 npm 可执行文件。”

哪个 npm returns /usr/local/bin/npm 放大版本 4.41.2

如果您创建了未使用的 lambda 函数,请执行 amplify remove function 并删除未使用的函数。在我的案例中,这就是触发相同错误的原因。