Error - Cannot read property 'indexOf' of null

I’m trying to deploy an application that I created from this command

serverless create --template aws-nodejs --path my-service

but when I go to the directory createad and run the command serverless deploy , I get the message below, and it doesn’t show much information about the error:

$ serverless deploy -v
Serverless: Packaging service…
Type Error ---------------------------------------------
Cannot read property ‘indexOf’ of null
For debugging logs, run again after setting the “SLS_DEBUG=*” environment variable.
Stack Trace --------------------------------------------

I already configured my aws account and I always get this same message even for others tutorials.

Does anyone knows how to fix this problem?

What version of Serverless have you got installed? If none of the examples are working, it might be a version issue.