Serverless deploy fails with ENOENT: no such file or directory

I get a strange error message when deploying my lambda function:

$ serverless deploy
Serverless: Bundling with Webpack...
Serverless: Packaging service...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Error --------------------------------------------------
ENOENT: no such file or directory, stat '/Users/myuser/myservice/.serverless/.serverless/myservice.zip'

Note the part with ā€˜.serverless/.serverlessā€™ : When I simply say ā€œserverless packageā€, everything works fine, and the zip file is at .serverless/myservice.zip instead of .serverless/.serverless/myservice.zip

What can I do?
It is Mac OS X 10.14.3 with node 10.6.0 and serverless 1.39.0

2 Likes

I literally just created a topic about this. Iā€™m getting the exact same error. It seemed to start happening yesterday after no changes to my configuration files. It only happens whe I use the serverless-webpack plugin. I tried to create a fresh porject with the hello-world template and the deploy succeeded.

Wow, thanks for the fast answer, gabrielvincent!

When I take out the webpack plugin from serverless.yml, the deployment works.

However, I need webpack because my project is written in Typescript. Did anybody change the webpack plugin today? If so, can I lock down the plugin to yesterdayā€™s version?

Got it: Itā€™s not the webpack plugin, itā€™s the serverless script itself!
1.39.0 ā€¢ Public ā€¢ Published 2 days ago

With 1.38.0, everything still works fine! 1.39.0 must be the cause.

Yes. An issue was opened on Github:

2 Likes