Skip to content

install not effective unless in package.json #42

Description

@picsoung

I had some issues while installing this plugin.

Tried to install running npm install serverless-optimizer-plugin --save
and added "plugins": ["serverless-optimizer-plugin"] on s-project.json file.

But after that running any sls command gave me an error:

sls                                                            ⏎
/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

ServerlessError: This plugin could not be found: serverless-optimizer-plugin
    at new ServerlessError (/usr/local/lib/node_modules/serverless/lib/Error.js:17:11)
    at Serverless._loadPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:298:17)
    at Serverless.loadProjectPlugins (/usr/local/lib/node_modules/serverless/lib/Serverless.js:245:10)
    at /usr/local/lib/node_modules/serverless/lib/Serverless.js:76:41
From previous event:
    at Serverless.init (/usr/local/lib/node_modules/serverless/lib/Serverless.js:72:25)
    at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:17:12)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)
    at node.js:999:3

The only to make it work for me was to create an package.json file at project root and add this line in dependencies

"serverless-optimizer-plugin": "https://github.com/serverless/serverless-optimizer-plugin.git"

Unfortunately I have no idea what went wrong before ... so I can't really help solving this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions