Getting error "Offline requires Serverless v1.x.x.."

I’ve inherited an app that was configured using serverless 1.x. I installed serverless 2.x, and when I run the command sls offline it no longer works. Is there a substitute command for serverless 2.x?

Try updating your version of serverless-offline.
Looking at package.json the their repo it looks like they even have serverless v.2.2.0 as a dev dependency.

Hi @gabsong,

First of all, sorry for my English
Second, I guess you have the same problem that I had a few days ago.
I’m not sure, but maybe this few lines, can help you.

Commands

$ mkdir hello-world
$ npm init -y
$ npm create -t aws-nodejs -n=hello-world
$ npm install serverless-offline --save-dev

Then perhaphs you recieve a lot warning messages like this:

npm WARN deprecated @hapi/vise@3.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/PACKAGE@NUMBER… BLA, BLA, BLA

and finally…

npm WARN serverless-offline@6.8.0 requires a peer of serverless@>=1.60.0 but none is installed. You must install peer dependencies yourself.

This means that you need install some stuff MANUALLY in this specific case:

$ npm install serverless@>=1.60.0 --save-dev

I hope this can help you :slight_smile:

Regards
AJM