0
votes

https://docs.strongloop.com/display/public/LB/Storage+component

I want use cli "apic create --type datasource" to setup my "/server/datasources.json" but it show the error

? Enter the data-source name: x ? Select the connector for x: other ? Enter the connector name without the loopback-connector- prefix: x undefined events.js:154 throw er; // Unhandled 'error' event ^

TypeError: Cannot read property 'package' of undefined at module.exports.yeoman.generators.Base.extend.installConnector (/usr/local/lib/node_modules/apiconnect/node_modules/generator-loopback/datasource/index.js:203:25) at /usr/local/lib/node_modules/apiconnect/node_modules/yeoman-generator/lib/base.js:430:16 at tryOnImmediate (timers.js:534:15) at processImmediate [as _immediateCallback] (timers.js:514:5)

1

1 Answers

1
votes

This appears to be a bug in the generator-loopback module. I have sent a PR to fix:https://github.com/strongloop/generator-loopback/pull/180

In the meantime, you can update datasources.json manually, as suggested in the docs, e.g.:

"myfile": {
   "name": "myfile",
   "connector": "loopback-component-storage",
   "provider": "amazon",
   "key": "your amazon key",
   "keyId": "your amazon key id"
 }

https://docs.strongloop.com/display/public/LB/Storage+component#Storagecomponent-UsingCLIandJSON