express icon indicating copy to clipboard operation
express copied to clipboard

serverless@components version is undefined / serverless cli asking for "service/provider"

Open serverlessguru opened this issue 5 years ago • 1 comments

Issue: I've installed serverless@components CLI, tried to create a serverless.yml, but am seeing this error.

Try to sls login with npm i serverless@components -g:

➜  slspro git:(master) ✗ sls login
 
  Serverless Error ---------------------------------------
 
  "provider" property is missing in serverless.yml
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.6.0
     Framework Version:         1.63.0-components-v2-beta
     Plugin Version:            3.4.1
     SDK Version:               2.3.0
     Components Version:        undefined
   ╭──────────────────────────────────────────────────────────╮
   │                                                          │
   │   Update available 1.63.0-components-v2-beta → 1.64.0    │
   │              Run npm i serverless to update              │
   │                                                          │
   ╰──────────────────────────────────────────────────────────╯

Follow advice of updating to npm i serverless -g:

➜  slspro git:(master) ✗ npm i serverless -g
/usr/local/bin/serverless -> /usr/local/lib/node_modules/serverless/bin/serverless.js
/usr/local/bin/slss -> /usr/local/lib/node_modules/serverless/bin/serverless.js
/usr/local/bin/sls -> /usr/local/lib/node_modules/serverless/bin/serverless.js

> [email protected] postinstall /usr/local/lib/node_modules/serverless
> node ./scripts/postinstall.js
   ┌───────────────────────────────────────────────────┐
   │                                                   │
   │   Serverless Framework successfully installed!    │
   │                                                   │
   │   To start your first project run 'serverless'.   │
   │                                                   │
   └───────────────────────────────────────────────────┘

+ [email protected]
added 2 packages from 3 contributors, removed 34 packages, updated 6 packages and moved 1 package in 15.868s

Try to sls login again:

➜  slspro git:(master) ✗ sls login          
 
  Serverless Error ---------------------------------------
 
  "provider" property is missing in serverless.yml
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.6.0
     Framework Version:         1.64.0
     Plugin Version:            3.4.1
     SDK Version:               2.3.0
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

In the attached image you can see the line saying "component version: Undefined" and you can see that following the CLI advice and running npm install serverless -g gives the same error. That our component file is missing a "service/provider" which shouldn't be required for components.

Screen Shot 2020-02-24 at 4 26 42 PM

serverlessguru avatar Feb 25 '20 00:02 serverlessguru

Update your serverless package to the latest version

Gr8z avatar Apr 03 '20 08:04 Gr8z