I am trying to get the serverless framework to work on my current LTS Ubuntu machine. I installed the framework unsing node and created a project for aws.
When I run "sls deploy --stage XXX" I get the following error:
Error: EACCES: permission denied, rmdir '/home/tony/Documents/bdsm/.serverless/.requirements_cache/7cc4959877dbe6b6c63a8eb1bfe3bfb545fa8fe5b28b1b2c13e4a7c1c0d1c4d4_x86_64_slspyc/bin'
at Object.rmdirSync (node:fs:1217:10)
at rmdirSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:264:13)
at rimrafSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:243:7)
at /home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:39
at Array.forEach (<anonymous>)
at rmkidsSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:26)
at rmdirSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:269:7)
at rimrafSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:243:7)
at /home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:39
at Array.forEach (<anonymous>)
at rmkidsSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:26)
at rmdirSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:269:7)
at rimrafSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:243:7)
at /home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:39
at Array.forEach (<anonymous>)
at rmkidsSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:279:26)
at rmdirSync (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:269:7)
at Object.rimrafSync [as removeSync] (/home/tony/Documents/bdsm/node_modules/fs-extra/lib/remove/rimraf.js:243:7)
at AwsCommon.cleanupTempDir (/home/tony/Documents/bdsm/node_modules/serverless/lib/plugins/aws/common/lib/cleanupTempDir.js:12:13)
at aws:common:cleanupTempDir:cleanup (/home/tony/Documents/bdsm/node_modules/serverless/lib/plugins/aws/common/index.js:50:55)
at PluginManager.runHooks (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:601:41)
at PluginManager.invoke (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:639:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async PluginManager.spawn (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:663:5)
at async package:cleanup (/home/tony/Documents/bdsm/node_modules/serverless/lib/plugins/aws/package/index.js:85:9)
at async PluginManager.runHooks (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:601:35)
at async PluginManager.invoke (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:639:9)
at async PluginManager.spawn (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:663:5)
at async before:deploy:deploy (/home/tony/Documents/bdsm/node_modules/serverless/lib/plugins/deploy.js:65:11)
at async PluginManager.runHooks (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:601:35)
at async PluginManager.invoke (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:638:9)
at async PluginManager.run (/home/tony/Documents/bdsm/node_modules/serverless/lib/classes/PluginManager.js:700:7)
at async Serverless.run (/home/tony/Documents/bdsm/node_modules/serverless/lib/Serverless.js:468:5)
at async /home/tony/Documents/bdsm/node_modules/serverless/scripts/serverless.js:836:9
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
There is also a topic on the serverless github which is similar to mine: https://github.com/serverless/serverless/issues/3993
The problem, it seems, are related to permissions within the project folder. The framework tries to remove a folder, but gets an error, that it does not have the relevant permissions.
This is curious since I tried all the steps, I found in the gitlab topic. They involved chmod 777 for the .serverless folder, was well as just removing the .serverless folder and trying to deploy again.
When I try to deploy after deleting the .serverless folder, it seems like the framework creates the folder and its contents and then tries to remove some of those contents again, but at this point does not have the permissions to do so. Which to me seems a bit odd and I am unable to make sense of it.