Hi,
New to serverless, writing my first program and will probably sound dumb with the question.
Ran the hello world and realized that âserverless deployâ looks for serverless.yml. I downloaded a sample application which had a s-function.json, s-resources-cf.json and other files but no serverless.yml. While trying to deploy resources, i get an error which says âcommand resources not foundâ. What am i missing? Thanks in advance.
The sample you downloaded was for a Serverless v0.5x project and you are probably using serverless v1.0.0-rc2.
What I would do is create a new folder, go into that folder and then create a new serverless service using serverless create --template aws-nodejs --name my-special-service (assuming you are creating a nodejs service, see https://github.com/serverless/serverless/blob/master/docs/01-guide/02-creating-services.md) and then move in just the javascript code from the sample project that you need, and not the surrounding old-style serverless project configuration.
Just to add to @ianserlinâs already good answer: v0.x and v1.x Serverless projects are completely different. The project was re-written, so you can basically assume that anything for v0.x is irrelevant for you v1.x service.
Thank you @ianserlin and @rowanu. I now run into a different problem. My js file has the const request = require(ârequestâ); and i get an error saying âCannot find module ârequestââ. I am running v1.0.1-rc.2. Should i explicitly define the dependency on npm_modules somewhere in my configuration? If not, how could i fix this issue?