loopback-getting-started-intermediate icon indicating copy to clipboard operation
loopback-getting-started-intermediate copied to clipboard

Problem running the creation of a AngularJS client

Open Frank-G opened this issue 8 years ago • 3 comments

Hi, I tried to complete the tutorial in [1]. But I failed at step 6 with the following error message:

root@mymachine:~/myfolder# lb-ng server/server.js client/js/services/lb-services.js
Loading LoopBack app "/home/ubuntu/simpletest/server/server.js"
Generating "lbServices" for the API endpoint "/api"
Warning: scope User.accessTokens targets class "AccessToken", which is not exposed
via remoting. The Angular code for this scope won't be generated.
Warning: scope Reviewer.accessTokens targets class "AccessToken", which is not exposed
via remoting. The Angular code for this scope won't be generated.
/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:322
  throw err;
  ^

ReferenceError: ejs:526
    524|             /**
    525|              * @ngdoc method
 >> 526|              * @name <%- moduleName %>.<%- modelName %>#<%- methodName %>
    527|              * @methodOf <%- moduleName %>.<%- modelName %>
    528| <% if (action.deprecated) { -%>
    529|              * @deprecated <%- action.deprecated %>

moduleName is not defined
    at ngdocForMethod (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:537:17)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:89:5)
    at Array.forEach (native)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:549:12), <anonymous>:87:21)
    at returnedFn (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:580:17)
    at Object.exports.render (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/ejs/lib/ejs.js:384:37)
    at Object.generateServices [as services] (/usr/local/lib/node_modules/loopback-sdk-angular-cli/node_modules/loopback-sdk-angular/lib/services.js:102:14)
    at EventEmitter.runGenerator (/usr/local/lib/node_modules/loopback-sdk-angular-cli/bin/lb-ng.js:53:26)
    at emitNone (events.js:67:13)
    at EventEmitter.emit (events.js:166:7)
    at /home/ubuntu/simpletest/node_modules/loopback-boot/lib/executor.js:63:9
    at /home/ubuntu/simpletest/node_modules/loopback-boot/node_modules/async/lib/async.js:251:17
    at /home/ubuntu/simpletest/node_modules/loopback-boot/node_modules/async/lib/async.js:154:25
    at /home/ubuntu/simpletest/node_modules/loopback-boot/node_modules/async/lib/async.js:248:21
    at /home/ubuntu/simpletest/node_modules/loopback-boot/node_modules/async/lib/async.js:612:34
    at nextTickCallbackWith0Args (node.js:419:9)

To reproduce this you only have to:

$ git clone https://github.com/strongloop/loopback-getting-started-intermediate.git
$ cd loopback-getting-started-intermediate
$ git checkout step6
$ npm install
$ npm install -g loopback-sdk-angular-cli
$ mkdir -p client/js/services
$ lb-ng server/server.js client/js/services/lb-services.js

Which is what is just written in the Tutorial.

What am I doing wrong? Or is the tutorial not working at the moment?

My version of the loopback cli tools (lb) is

$ lb -v
> 4.1.0 ([email protected] [email protected])

[1] https://loopback.io/doc/en/lb3/Create-AngularJS-client.html

Frank-G avatar Mar 14 '18 18:03 Frank-G

I follow the steps (clone,checkout,etc) to reproduce it but I do not have the same result:

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

Cargando la aplicación LoopBack "loopback-getting-started-intermediate/server/server.js"
Generando "lbServices" para el punto final de API "/api"
Warning: scope User.accessTokens targets class "AccessToken", which is not exposed 
via remoting. The Angular code for this scope won't be generated.
Warning: scope Reviewer.accessTokens targets class "AccessToken", which is not exposed 
via remoting. The Angular code for this scope won't be generated.
Guardando el origen de servicios generado en "loopback-getting-started-intermediate/client/js/services/lb-services.js"

My version of the loopback cli tools (lb) is

$ lb -v
>4.1.0 ([email protected] [email protected])

cristtopher avatar Apr 06 '18 15:04 cristtopher

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 05 '18 16:06 stale[bot]

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar Jun 19 '18 17:06 stale[bot]