loopbackjs

Loopback Installation: "The term 'lb4' is not recognized"


I have installed the Loopbackjs and when I am trying to run lb4 command it is showing the error.

lb4: The term 'lb4' is not recognized as the name of a cmdlet,
> function, script file, or operable program. Check the spelling of the
> name, or if a path was  included, verify that the path is correct and
> try again. At line:1 char:1
> + lb4 app
> + ~~~
>     + CategoryInfo          : ObjectNotFound: (lb4:String) [], CommandNotFoundException
>     + FullyQualifiedErrorId : CommandNotFoundException  
> 
> lb4: The term 'lb4' is not recognized as the name of a cmdlet,
> function, script file, or operable program. Check the spelling of the
> name, or if a path was  included, verify that the path is correct and
> try again. At line:1 char:1
> + lb4 app
> + ~~~
>     + CategoryInfo          : ObjectNotFound: (lb4:String) [], CommandNotFoundException
>     + FullyQualifiedErrorId : CommandNotFoundException

Solution

  • The CLI tool lb4 is shipped in the npm package @loopback/cli. You need to install this package globally. See Getting Started:

    STEP 2

    Install LoopBack 4 CLI

    The LoopBack 4 CLI is a command-line interface that can scaffold a project or extension. The CLI provides the fastest way to get started with a LoopBack 4 project that adheres to best practices.

    $ npm install -g @loopback/cli