'AdonisJs - Cannot find module
In AdonisJS I created a controller with core command node ace make:controller TodoController
, but I am getting this Cannot find module
Creating Controller:
node ace make:controller TodoController
Routes.ts:
import Route from "@ioc:Adonis/Core/Route";
Route.get("/", "homeController.index");
Route.group(() => {
Route.get("/todo", "TodoController.index");
Route.post("/todo", "TodoController.store");
Route.patch("/todo/:id", "TodoController.update");
Route.delete("/todo/:id", "TodoController.delete");
}).prefix("/api");
Solution 1:[1]
I was having the same error when I upgraded to a newer adonis version.
After an upgrade you should run this command on your terminal (inside your project root)
node ace generate:manifest
This will index your ace commands and your problem should be solved.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | xV0lk |