question

SagiLo avatar image
SagiLo asked

"Error: ENOENT: no such file or directory" when trying to upload lambda

➜ /Users/sagi/src/skill-name/lambda/custom git:(master) ✗ ask lambda upload -f lambda-name 
events.js:165 
      throw er; // Unhandled 'error' event 
      ^

Error: ENOENT: no such file or directory, open '/Users/sagi/src/skill-name/lambda/custom/Users/sagi/src/skill-name/lambda/custom/asktemp_53423TIuGwx1gJvoz.zip' 
Emitted 'error' event at: 
    at WriteStream.onerror (/usr/local/lib/node_modules/ask-cli/node_modules/readable-stream/lib/_stream_readable.js:640:52) 
    at WriteStream.emit (events.js:180:13) 
    at WriteStream.emit (domain.js:422:20) 
    at fs.open (fs.js:2225:12) 
    at FSReqWrap.oncomplete (fs.js:153:20)

Looks like absolute path appended to the current path and the temp file is rightfully not there.

ask --version
1.4.1

I reverted ask-cli back to version 1.3.1 and the issue is gone (still happens in 1.4.0, npm failed to find version 1.3.2)

alexa skills kitlambdaask cli
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ron Wang avatar image
Ron Wang answered

Hi @NewUser-30d84df2-2f9a-4b9d-991a-6bae081e64cf!

Thanks you for using CLI, and sorry for this problem. It seems CLI has a bug for the lambda upload command. We will release the bug fix for it and please stay tuned for cli's new version.

For now, if you are developing the lambda for an existing skill in a CLI skill project, can you try run "ask deploy --target lambda" at the root of the skill project for Lambda's upload?

Let me know if this alternative helps,

Ron

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jenn@amazon avatar image
Jenn@amazon answered

Looks like you're in the wrong folder: /Users/sagi/src/skill-name/lambda/custom

The error shows it looking for a file in: /Users/sagi/src/skill-name/lambda/custom/Users/sagi/src/skill-name/lambda/custom/asktemp_53423TIuGwx1gJvoz.zip

Try running the command in the top level folder: /Users/sagi/src/skill-name

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.