Error: Cannot find module '@adminjs/design-system'

Viewed 44

I installed AdminJS and was trying to run my application but I am coming across this Error

It says: Error: Cannot find module '@adminjs/design-system'

Even though design-system exists and I even added it as a require statement

const AdminJSDesignSystem = require("./@adminjs/design-system");

I also tried installing it again but it gave a huge error Right here

Please help me fix this. I have got here after being through so many errors and fixing them and even now these errors won't stop popping up.

3 Answers

looks like you are importing it using a relative path.

You should change that to just the package name

e.g. const AdminJSDesignSystem = require("@adminjs/design-system");

You need to do something like this:

const AdminJSDesignSystem = require("@adminjs/design-system");

Make sure you have followed the official guide of AdminJS and adminjs/design-system that:

  1. You have the admin user right to install things on your machine.

  2. You have installed one of Express, Hapi and Koajs. If not,

    npm install express express-formidable
    
  3. You have installed AdminJS. If not,

    npm install adminjs @adminjs/express
    
  4. Finally, install according to the official doc:

    npm install styled-components @adminjs/design-system
    
Related