Questions tagged [adonis.js]

Adonis is a full stack, open source MVC framework for Node.js. The framework is inspired by the PHP framework Laravel.

AdonisJs is an MVC Framework for Node.js.

It includes:

  • Lucid ORM
  • Database Migrations
  • Authentication System
  • OAuth
  • Mailing System
  • Data Validator
  • Testing

Learn more on the website and check out the organization on Github.

739 questions
140
votes
26 answers

How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?

I want to run this project : https://github.com/adonis-china/adonis-adminify When I run npm install, there exist error : > sqlite3@3.1.13 install C:\laragon\www\adonis-admin\node_modules\sqlite3 > node-pre-gyp install…
moses toh
  • 12,344
  • 71
  • 243
  • 443
15
votes
3 answers

What does ':' colon do in JavaScript's import?

Given the example below. import { QueryClientContract, TransactionClientContract } from '@ioc:Adonis/Lucid/Database' The use of the colon has confused me and never understood where the imported files could be referenced from.
myckhel
  • 800
  • 3
  • 15
  • 29
8
votes
1 answer

How i can alter a column type without lose the database data in migration using adonis?

I have this class: class BookUnitQuestionSchema extends Schema { up () { this.create('book_unit_question', (table) => { table.increments() table.integer('book_unit_id').references('id').inTable('book_unit') …
bla
  • 995
  • 3
  • 11
  • 44
8
votes
1 answer

React with Adonis

I am trying to integrate React with Adonis Js to build an SPA. Adonis handles routing to an SPA by Route.any('*', function * (request, response) { yield response.sendView('home') }) I have done exactly that in app > Http > routes.js Then I created…
Roy
  • 359
  • 1
  • 4
  • 11
7
votes
1 answer

AdonisJS - How to return validation messages according to the locale of Antl Provider

I'm applying internationalization to my API and I'm having some issues related to Antl and validation messages. With standard response messages, I'm returning according to the locale set by the user. I created a route to switch locales and set to a…
Laura Beatris
  • 1,782
  • 7
  • 29
  • 49
6
votes
1 answer

JWT token not saved on database

A user's authentication returns the token, but it is not saved in the database AuthController: 'use strict' const User = use("App/Models/User"); class AuthController { async registrar({ request }) { const data = request.only(["username",…
di0n
  • 67
  • 8
6
votes
0 answers

Jest integration with Adonis V5

I'm developing an application with Adonis v5 but its test runner isn't finished. So, my workaround is to apply Jest in its place. I got this working but I'm having trouble importing types from Adonis. In any model, I have the following…
leandroungari
  • 131
  • 1
  • 7
6
votes
3 answers

Gitlab CI variables returns empty string?

It's been 2 days since one of my project' build starts failing on Gitlab CI. The main error was E_MISSING_APP_KEY and when I check another variable just by echoing $HOST and $PORT from my .gitlab-ci.yml config, like this tests: script: - echo…
Fery W
  • 1,402
  • 1
  • 15
  • 28
6
votes
3 answers

Persisted state from VueX and NuxtJS

I use vuex-persistedstate package (https://github.com/robinvdvleuten/vuex-persistedstate) to persist data state on browser. I use Adonuxt (a mix between NuxtJS and AdonisJS). In VueX actions, I have this action: nuxtClientInit ({commit}) { //…
pirmax
  • 2,054
  • 8
  • 36
  • 69
5
votes
1 answer

What causes IocLookupException?

I wonder what causes IocLookupException in an adonis project. To be more specific, E_IOC_LOOKUP_FAILED: Cannot resolve "..." namespace from the IoC Container What methods/tools can be used to determine the root of the issue so that you can prevent…
Clay
  • 747
  • 7
  • 12
5
votes
2 answers

Error: Cannot find module 'phc-argon2' Adonis Js

Hi everybody I try use hash in password model but if i try save a new user adonis send me this error : Error: Cannot find module 'phc-argon2' I find in official documentation of adonis but i not found some solution... this is my model : import {…
Gario3
  • 139
  • 2
  • 13
5
votes
2 answers

adonis issue: error: `migration:run` is not a registered command

I Have installed @adonisjs/lucid. create a migration to use command adonis make:migration task ** task code** 'use strict' const Schema = use('Schema') class TaskSchema extends Schema { up() { this.create('tasks', table => { …
Jamil Ahmed
  • 284
  • 3
  • 17
5
votes
1 answer

How do I set a default value using enum type in column Mysql using Knex.js?

I am using AdonisJS to make a backend application. In migrations, specifically in models, we have the option of creating models, but I can't use a default value in enun type. After reading the Knex.js documentation, I couldn't find a way to put this…
5
votes
3 answers

RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received NaN

I am using Ubuntu 18.04 I was trying to run npm by "npm start". I am getting the above error. Anyone help me in resolving this error. ` WARNING: Adonis has detected an unhandled promise rejection, which may cause undesired behavior in…
5
votes
2 answers

Ignore specific error for eslint in the whole project

I'm using AdonisJs (NodeJS framework) and they created a function called use to import file like they'd be namespaces, for example use('App/Services/User') instead of require('../app/Services/User'). The problem is that eslint will throw the error…
Theraloss
  • 700
  • 2
  • 7
  • 30
1
2 3
49 50