Serverless-offline: Serverless plugin "serverless-offline" not found

Created on 17 Jul 2018  ยท  10Comments  ยท  Source: dherault/serverless-offline

Hey,

I'm trying to deploy a serverless service, with the command line:

serverless deploy --package dist-qa --stage qa -v

But I get the following error:

Serverless plugin "serverless-offline" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.

I've a project in serverless 1.28.0

Here is my devDependencies from package.json:

"devDependencies": {
    "chai": "^4.1.2",
    "eslint": "^5.1.0",
    "mocha": "^5.2.0",
    "nyc": "^12.0.2",
    "serverless-offline": "^3.25.6"
  },
"dependencies": {
  "aws-sdk": "^2.272.1",
  "moment": "^2.22.2"
}

Here is my serverless.yml:

service: hello

package:
  exclude:
    - test/**
    - dist-*/**

plugins:
  - serverless-offline

provider:
  name: aws
  runtime: nodejs8.10
functions:
  hello:
    handler: modules/hello/handler.hello
    events:
      - http:
          path: hello
          method: get

What am I doing wrong?

Most helpful comment

I found the issue... Plugins was nested under provider: I moved the plugins key to the bottom and offline starts fine.

All 10 comments

Have you checked the node_modules folder? is serverless-offline really installed?

I think this is a npm issue (try npm install). Closing.

It's necessary to have all dependencies (even devDependencies) on deploy.

In Jenkins on deploy time We didn't have devDeps on node_modules that's because I was getting that error.

I am having this problem, here are my deps:

 "dependencies": {
    "@octokit/rest": "^15.15.1",
    "@types/axios": "^0.14.0",
    "@types/node": "^10.12.1",
    "axios": "^0.18.0",
    "http": "0.0.0",
    "proxy-agent": "^3.0.3"
  },
  "devDependencies": {
    "@types/aws-lambda": "^8.10.14",
    "serverless-offline": "^3.30.0",
    "serverless-plugin-typescript": "^1.1.5"
  } 

Try remove your node_modules folder and run npm install

I've tried a few times, no dice. I Cleared out some npm proxy config settings, to see if that might be impacting things. Running npm audit, i get the below warnings:

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ High โ”‚ Insufficient Entropy โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Package โ”‚ cryptiles โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Patched in โ”‚ >=4.1.2 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Dependency of โ”‚ serverless-offline [dev] โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Path โ”‚ serverless-offline > hapi > cryptiles โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ More info โ”‚ https://nodesecurity.io/advisories/720 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

I found the issue... Plugins was nested under provider: I moved the plugins key to the bottom and offline starts fine.

The problem for me was that serverless-offline is under devDependencies. My CI server (like most others) only installs prod dependencies which caused a build failure.

It would be good if it were possible to deploy a project with serverless-offline without moving it to dependencies.

Workaround: move serverless-offline from devDependencies to dependencies

The problem for me was that serverless-offline is under devDependencies. My CI server (like most others) only installs prod dependencies which caused a build failure.

It would be good if it were possible to deploy a project with serverless-offline without moving it to dependencies.

Workaround: move serverless-offline from devDependencies to dependencies

same issue serverless-offline wouldnt work in devDependencies

I'd vote to re-open this issue, since it can't be an accepted solution to put serverless-offline to the dependencies, which is definitely a dev dependency!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Looveh picture Looveh  ยท  4Comments

davidroman0O picture davidroman0O  ยท  4Comments

ozbillwang picture ozbillwang  ยท  4Comments

Ali-Dalal picture Ali-Dalal  ยท  4Comments

FranzSkuffka picture FranzSkuffka  ยท  3Comments