TS: Install Lucid

Hi peoples!

How to install Lucid in typescript adonis project

I created a project with create-adonis-ts-app
And now I need add Lucid ORM

I tried install globally the cli with: npm i -g @adonisjs/cli and execute on root project this command:

adonis install @adonisjs/lucid

Then I recieve this error:

class BaseCommand extends ace.Command {

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Users\notebook\AppData\Roaming\npm\node_modules\@adonisjs\cli\src\Commands\Base\index.js:17:31)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\notebook\AppData\Roaming\npm\node_modules\@adonisjs\cli\src\Commands\New\index.js:13:21)
    at Module._compile (internal/modules/cjs/loader.js:701:30)

Hey @max10rogerio! :wave:

You are trying to mix Adonis 5 packages with Adonis 4 packages. I’d recommend you to wait until Adonis 5 is released.

Hello @romain.lanz,

I’m trying use Adonis with Typescript…

This is a test with the package “create-adonis-ts-app”…

I created project with default settings and now I need install Lucid ORM.

I don’t know if I will have problems installing Lucid only with command: “yarn add @adonisjs/lucid”

The new version of Adonis (V5), that is going to be released at the end of the month will be TypeScript based.

The CLI you are trying to use create a boilerplate to use V5, but it’s not complete.
You should wait for the release if you want to have no issue.

1 Like