serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

Plugin is not a constructor

Open tniermann opened this issue 10 years ago • 6 comments

With serverless version 1.0.3: install serverless-offline (v3.2.1) ,

And create a service with

serverless create --template aws-nodejs --path myService When I add the following to the serverless.yml file

plugins:

  • serverless-offline

I get teh following when I run serverless or serverless --version TypeError: Plugin is not a constructor at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:28:28)

tniermann avatar Oct 31 '16 19:10 tniermann

What is your Nodejs version? This plugin is v4 and higher. Note to self: put "engines" back in package.json

dherault avatar Oct 31 '16 19:10 dherault

node version 6.9.1

tniermann avatar Oct 31 '16 20:10 tniermann

Mmm. Can you clone this repo, cd into it, npm i, cd into manual_test, npm i and npm start to see if you get the same bug?

dherault avatar Oct 31 '16 21:10 dherault

I get the same error. I will see if I can diagnosis in the debugger

TypeError: Plugin is not a constructor at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:28:28)

tniermann avatar Nov 01 '16 15:11 tniermann

Ok, maybe restart from scratch?

sudo npm uninstall -g serverless
sudo npm i -g serverless
serverless create -t aws-nodejs --path somedir
cd somedir
npm i -D serverless-offline

dherault avatar Nov 01 '16 15:11 dherault

A clean install from scratch worked. Thanks. I had been using prior versions of serverless

tniermann avatar Nov 01 '16 15:11 tniermann