nrempel / adonis-scheduler

This library provides an easy way to schedule recurring tasks for AdonisJS.
MIT License
104 stars 32 forks source link

error: `make:task` is not a registered command #12

Closed minhphuc429 closed 6 years ago

minhphuc429 commented 6 years ago

I use adonis version 4.1.0, i had config in start/app.js, when i run adonis make:task Example it show this error error:make:taskis not a registered command. how to fix it?

nrempel commented 6 years ago

Did you register the ace command?

const aceProviders = [ ... 'adonis-scheduler/providers/CommandsProvider' ]

minhphuc429 commented 6 years ago

Yes, I registered. This my app.js https://pastebin.com/NyVG3pWi

ccocot commented 6 years ago

i have same problem

ntvsx193 commented 6 years ago

Hello everyone! I'm write incorrect sample for generate task from command. You need use command node ace make:task .... The adonis cli is not included custom commands. I will change this typos in readme.md.

Also, you can get all supported commands for adonis and node ace via type this commands.

Thanks for feedback!

minhphuc429 commented 6 years ago

I change adonis make:task Example to node ace make:task Example but it still return error: make:task is not a registered command

ntvsx193 commented 6 years ago

I'm build clean adonis default app, add dependency from readme.

throw:test-adonis verchu$ node ace
Usage:
  command [arguments] [options]

Global Options:
  --env           Set NODE_ENV before running the commands
  --no-ansi       Disable colored output

Available Commands:
 make
  make:task       Make a new task scheduler
 run
  run:scheduler   Start the scheduler.
minhphuc429 commented 6 years ago

Are you sure it works? I try to create new adonis project 5.0.4 base on node.js v8.9.4 but it still not working

webdevian commented 6 years ago

@ntvsx193 @minhphuc429 This isn't working for me either. When I add 'adonis-scheduler/providers/CommandsProvider' to aceProviders and run ace or adonis I only get:

Available Commands:
 make
  make:task       Make a new task scheduler
 run
  run:scheduler   Start the scheduler.

But neither of these commands work. If I remove it I get the full list of adonis commands

webdevian commented 6 years ago

This is what I have installed:

    "@adonisjs/ace": "5.0.0",
    "@adonisjs/cli": "4.0.4",
    "@adonisjs/fold": "4.0.7",
    "@adonisjs/framework": "5.0.4",
    "@adonisjs/ignitor": "2.0.5",
    "@adonisjs/lucid": "5.0.3",
    "@adonisjs/mail": "3.0.5",
    "@adonisjs/redis": "2.0.4",
    "adonis-kue": "4.0.0",
    "adonis-scheduler": "3.0.0",
webdevian commented 6 years ago

I think it's because the package includes ace, fold and ignitor as dependencies instead of peer dependencies, so the commands aren't extending the same instance of ace or fold as the actual ace file

webdevian commented 6 years ago

Yes, it's different in this repository than 3.0.0 on NPM. When I install direct from github it works ok

nrempel commented 6 years ago

Hey @webdevian, glad you got it working. I still need to publish the latest version to npm. It’s been a busy couple weeks. I’ll do that ASAP.

webdevian commented 6 years ago

Thanks. It's a problem I had when making adonis-pug, everything in the repo looked right but once I installed it in another app with parallel adonis packages stuff like this started breaking

nrempel commented 6 years ago

I've published 3.0.1 to npm. Would everyone mind trying to install from npm to see if it works for you?

Thank you.

webdevian commented 6 years ago

Yeah that seems to work

nrempel commented 6 years ago

Thanks all