Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #1.2

Creating A New AdonisJS 6 Project

In This Lesson

We'll create our first AdonisJS 6 project and learn how we can boot it up and open it within VS Code.

Created by
@tomgobich
Published

Join the Discussion 17 comments

Create a free account to join in on the discussion
  1. I am new to adonis, I think we need to pay attention more to this than just the hyped who look for stability. Thankyou so much for the great work by making this tutorials.

    1
    1. Responding to fadli-hidayatullah
      @tomgobich

      Thank you for watching, Fadli! I hope you find as much enjoyment in working with AdonisJS as I have! 😊

      2
  2. thanks for this tutorial, but I have an issue when running, npm run dev.
    I got error like this
    Error: Cannot find package 'luxon'

    1
    1. Responding to mathius-kormasela
      @tomgobich

      Hi Mathius! Is this a brand new AdonisJS project? If so, make sure you're using at least version 20.6 of NodeJS. If you are, can you please share the repo? I can take a look and see if anything stands out.

      0
      1. Responding to tomgobich
        1
        1. Responding to mathius-kormasela
          @tomgobich

          Hmm… I just pulled down your repo, and ran npm i and it booted up a-okay. I'm using Node v20.14 as well. Maybe try deleting your package-lock.json and node_modules and rerunning npm i? Might've been some issue with NPM cache.

          0
          1. Responding to tomgobich

            ok, thank you

            1
            1. Responding to mathius-kormasela
              @tomgobich

              Anytime!!

              0
              1. Responding to tomgobich

                works well after giving permission to npm to access .npm folder.

                1
                1. Responding to mathius-kormasela
                  @tomgobich

                  Oh, good find! Happy to hear you were able to get it figured out!

                  0
  3. Hello / Good evening!

    I'm trying to install Adonis ts but I'm stuck at the installation level. Need help please!

    CUSTOMIZE PROJECT

    > Select the project structure · api

    > Enter the project name · hello-world

    > Setup eslint? (y/N) · true

    > Setup prettier? (y/N) · true

    RUNNING TASKS

    > Scaffold project 110 ms

    > Install dependencies 39 ms

    spawn EINVAL

    > Configure installed packages

    [ error ] Unable to create project. Cleaning up

    node:fs:1215

    binding.rmdir(pathModule.toNamespacedPath(path));

    ^

    1
    1. Responding to marley-apong
      @tomgobich

      Hi Marley! These steps don't seem in line with an AdonisJS 6 installation, what command did you use to try and install this project? Also, what NodeJS version are you using? Note, AdonisJS 6 requires NodeJS v20.6 or greater.

      1
      1. Responding to tomgobich

        Hello!

        For installing AdonisJS, I used the command npm init adonis-ts-app@latest hello-world with Node.js v20.16.0. At some point, I also used PNPM with pnpm create adonis-ts-app hello-world. I encountered the same error as you.

        0
        1. Responding to marley-apong
          @tomgobich

          The command to create a new AdonisJS 6 project is npm init adonisjs@latest, the same command shown in this lesson. Try giving that a go instead.

          0
          1. Responding to tomgobich

            Ok thanks, it's fine !

            0
  4. 1
    1. Responding to davide-zerrilli
      @tomgobich

      Hi Davide! Rick Strahl's blog is a fantastic resource, especially for .NET devs! If you don't have any localhost projects making use of HSTS, you should be able to just clear out your browser's HSTS cache to get things working again. You can find AdonisJS' HSTS config within config/shield.ts.

      If however, you'd like to work with or need to work with HTTPS locally, you may have luck giving Caddy a try! I've never worked with it, but it automatically comes with and renews TLS certs for HTTPS and works on localhost.

      0