Error: spawn serverless ENOENT

serverless deploy throws spawn serverless ENOENT Getting the below error when trying to deploy client-service, although before that all services are getting deployed.

Error: spawn serverless ENOENT

Using the below versions for serverless and serverless compose

"@serverless/compose": "^1.3.0",
"serverless": "^3.22.0",

serverless-compose.ts Configuration

const serverlessCompose = {
  services: {
    "infra-test": {
      path: "infra-test",
    },
    "client-service": {
      path: "client-'service'",
      dependsOn: ["infra-test"],
    },
  },
};

module.exports = serverlessCompose;

Full command name with used flags (If not applicable, fill with “N/A”)

serverless deploy --stage sbx

COMPLETE command output.

infra-test › 
infra-test › Stack Outputs:
infra-test ›   ServerlessDeploymentBucketName: infra-test-sbx-serverlessdeploymentbucket-yg91fd
infra-test › 3 deprecations found: run 'serverless doctor' for more details
infra-test › deployed
client-service › deploying
client-service › Running "serverless deploy --stage sbx"
client-service › error
client-service › spawn serverless ENOENT
client-service › Error: spawn serverless ENOENT
client-service ›     at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
client-service ›     at onErrorNT (node:internal/child_process:476:16)
client-service ›     at processTicksAndRejections (node:internal/process/task_queues:82:21)
  1. I’ve downgraded serverless-dynamodb-local 0.2.40 to version 0.2.30 by using
npm uninstall serverless-dynamodb-local
sls dynamodb uninstall

npm install serverless-dynamodb-local@0.2.30
sls dynamodb install
  1. removed all serverless local dependacies used by service
  2. tried with single lambda function as service earlier was having lot of lambdas
  3. installed sls dynamodb & java using sls dynamodb install java
➜  sls-compose git:(main) ✗ java --version
     openjdk 19 2022-09-20
     OpenJDK Runtime Environment Homebrew (build 19)
     OpenJDK 64-Bit Server VM Homebrew (build 19, mixed mode, sharing)

So the Issue was

   "client-service": {
      path: "client-'service'",
      dependsOn: ["infra-test"],
    }

in path “client-‘service’” there is a single inverted comma, which is a syntactical error causing this

The correct snippet is as follows:

 "client-service": {
      path: "client-service",
      dependsOn: ["infra-test"],
    },