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.

Published
Jan 24
Duration
5m 55s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Join The Discussion! (17 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 3 months ago

    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

    Please sign in or sign up for free to reply

    1. Commented 3 months ago

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

      2

      Please sign in or sign up for free to reply

  2. Commented 3 months ago

    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

    Please sign in or sign up for free to reply

    1. Commented 3 months ago

      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

      Please sign in or sign up for free to reply

      1. Commented 3 months ago

        yes, I'm using the latest node version 20.14.
        this is my repo
        https://github.com/mathiuskormasela12/hello-world

        1

        Please sign in or sign up for free to reply

        1. Commented 3 months ago

          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

          Please sign in or sign up for free to reply

          1. Commented 3 months ago

            ok, thank you

            1

            Please sign in or sign up for free to reply

            1. Commented 3 months ago

              Anytime!!

              0

              Please sign in or sign up for free to reply

              1. Commented 3 months ago

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

                1

                Please sign in or sign up for free to reply

                1. Commented 3 months ago

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

                  0

                  Please sign in or sign up for free to reply

  3. Commented 24 days ago

    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

    Please sign in or sign up for free to reply

    1. Commented 21 days ago

      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

      Please sign in or sign up for free to reply

      1. Commented 21 days ago

        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

        Please sign in or sign up for free to reply

        1. Commented 19 days ago

          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

          Please sign in or sign up for free to reply

          1. Commented 17 days ago

            Ok thanks, it's fine !

            0

            Please sign in or sign up for free to reply

  4. Commented 11 days ago

    Hi, thank you from Italy for this tutorial!! I have problem when I put http://localhost:3333 in my browser because it instantly switch to https and the site won't support it. I've just found this solution: https://weblog.west-wind.com/posts/2022/Oct/24/Fix-automatic-rerouting-of-http-to-https-on-localhost-in-Web-Browsers
    Do you have any suggestions about?

    1

    Please sign in or sign up for free to reply

    1. Commented 9 days ago

      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

      Please sign in or sign up for free to reply

Playing Next Lesson In
seconds