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?
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-offlineis underdevDependencies. 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-offlinewithout moving it todependencies.Workaround: move
serverless-offlinefromdevDependenciestodependencies
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!
Most helpful comment
I found the issue... Plugins was nested under provider: I moved the plugins key to the bottom and offline starts fine.