1

I'm going through the tutorials of http://docs.strongloop.com, and I've reached http://docs.strongloop.com/display/public/LB/Add+a+client+app.

Yet when I execute 'lb-ng ../server/server.js js/lb-services.js' I get an error: Cannot find module 'loopback'.

Any help would be appreciated!

Ana M
  • 657
  • 6
  • 9

4 Answers4

1

For the new version of loopback you need to install lb-ng command with this line of command

sudo npm install -g loopback-sdk-angular-cli

also try to be in the client folder make sure that you have js directory in client directory then execute these lb-ng commad

lb-ng ../server/server.js js/lb-services.js

it will work :)

AFTAB MUHAMMED KHAN
  • 2,189
  • 3
  • 18
  • 24
0

did you npm install your dependencies? check and see if you have a node_modules dir in your project root.

superkhau
  • 2,781
  • 18
  • 9
  • Yep. I do have node_modules, and node_modules/loopback. – Ana M Nov 17 '14 at 10:43
  • where are you executing 'lb-ng' from? 'lb-ng' accepts two args, thr first is the relative path to '/server/server.js' and the second is the relative path of where you want to generate the file. – superkhau Nov 17 '14 at 17:31
  • did you `cd` into the `client` dir? like are you executing the command inside the client dir? `lb-ng` is relative to where you execute to the command – superkhau Nov 17 '14 at 18:17
  • relevant paths: 'project/client/js', 'project/server/server.js'. I'm in the client dir, executing 'lb-ng ../server/server.js js/lb-services.js'. – Ana M Nov 17 '14 at 18:46
  • try scaffolding a new loopback app and generating it. are you using the latest version of loopback? `npm install -g strongloop`. do you have a directory in `client` named `js`? – superkhau Nov 17 '14 at 22:22
0

if you're using a newer version of node, try uninstalling node and reinstalling an LTS version.

npm uninstall -g strongloop

npm cache clear

npm install -g strongloop

This is how I fixed this problem for me.

adiga
  • 34,372
  • 9
  • 61
  • 83
SuperVeetz
  • 2,128
  • 3
  • 24
  • 37
0

install strong loop and then run lb-ng command this is how i fixed this problem

Bisma Azher
  • 689
  • 8
  • 9