loopback4-example-microservices
loopback4-example-microservices copied to clipboard
example doesn't run
Description/Steps to reproduce
git clone https://github.com/strongloop/loopback-next-example
cd loopback-next-example
npm run build
npm start
Expected result
app example runs
Additional information
/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:296
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
controllers/TransactionController.ts (1,10): Module '"/Users/danielq/Projects/Playground/loopback-next-example/services/transaction/node_modules/@loopback/core/index"' has no exported member 'api'. (2305)
at getOutput (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:296:15)
at /Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:325:16
at Object.compile (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:479:11)
at Module.m._compile (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:379:43)
at Module._extensions..js (module.js:584:10)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/danielq/Projects/Playground/loopback-next-example/node_modules/ts-node/src/index.ts:382:12)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
Same here, but with different controller:
/home/christoph/sources/loopback/loopback-next-example/node_modules/ts-node/src/index.ts:307
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
controllers/AccountManagementController.ts (1,10): Module '"/home/christoph/sources/loopback/loopback-next-example/services/facade/node_modules/@loopback/core/index"' has no exported member 'api'. (2305)
at getOutput (/home/christoph/sources/loopback/loopback-next-example/node_modules/ts-node/src/index.ts:307:15)
node version is 7.7.4
import { api } from '@loopback/core';
same error
Install loopback/rest package for all services with npm install @loopback/rest --save
then replace import { api } from '@loopback/core';
by import { api } from '@loopback/rest';
and it should work
thank you
So. Im install @loopback/rest (4-alpha-3) And bow have new error message
Cannot start the app. Error: The key http.port was not bound to any value. at FacadeMicroservice.getBinding (/home/andrey/projects/loopback-next-example/services/facade/node_modules/@loopback/context/src/context.ts:153:11)
Is this repository active status?
I solved this by adding the following in "services/facade/index.ts" at line 9 :
const app = this; app.bind('http.port').to(3004);
it seems to work but I don't understand next steps. It seems that app.start()
starts all the Server
of the application which seems not yet implemented..
Do you have the following messages when you run npm run build
?
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field
npm WARN [email protected] No repository field
Maybe the problem is here.
I'm still looking how to launch this example too
module.js:540 throw err; ^
Error: Cannot find module 'D:\loopback-next-example' at Function.Module._resolveFilename (module.js:538:15) at Function.Module._load (module.js:468:25) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3
same here not running
@shimks , could you PTAL to see if the problem still exists after this PR had landed? thanks.
Last time I checked, the repo's able to start, but not everything is functional. See https://github.com/strongloop/loopback4-example-microservices/issues/94 for more details
any news on this issue with loopback GA version?
@ex7r3me @suryacaprice @wolrajhti @apapacy @danielpiedra, sorry that we haven't been updating this repo. We've changed quite a lot since the last update. For now, if you would like to get some working example, you can the sample apps under https://github.com/strongloop/loopback-next/tree/master/examples, or a closer-to-real-life application: https://github.com/strongloop/loopback4-example-shopping.
I'd bring it up to the team on what's the best way to handle this repo. Thanks!
@dhmlau Hi, Isn't the best for the community just to close this repo if it is not working? I just wasted some time trying to get it to work ;( Thank you