Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

685
Visualizações
No such file or directory, lstat \async hooks required by \node_modules\on-finished\index.js

I am trying to figure out what I have done wrong with this Javascript code. I have tried googling the error with no avail.

The following is there error I get.

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat 'C:\Users\calon\source\repos\CAL0NZ0\Treasure-Box-Azure\async_hooks' required by C:\Users\calon\source\repos\CAL0NZ0\Treasure-Box-Azure\node_modules\on-finished\index.js

And here is the Javascript code used.

const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const { CosmosClient } = require('@azure/cosmos');
const config = require('./config');
const endpoint = config.endpoint;
const key = config.key;

const client = new CosmosClient({ endpoint, key });
const database = client.database('treasure_box');
const container = database.container('logins');

const app = express();

let initialPath = path.join(__dirname, 'treasure-box-azure');

app.use(bodyParser.json());
app.use(express.static(initialPath));

app.get('/', (req, res) => {
    res.sendFile(path.join(initialPath, 'index.html'));
});

app.get('/login', (req, res) => {
    res.sendFile(path.join(initialPath, 'login.html'));
});

app.get('/register', (req, res) => {
    res.sendFile(path.join(initialPath, 'register.html'));
});

app.post('/register-user', (req, res) => {
    const { name, email, password } = req.body;

    if (!name.length || !email.length || !password.length) {
        res.json('Fill out all field');
    } else {
        container
            .insert({
                name: name,
                email: email,
                password: password,
            })
            .returning(['name', 'email'])
            .then((data) => {
                res.json(data[0]);
            })
            .catch((err) => {
                if (err.detail.includes('Already Exists')) {
                    res.json('Email already exists');
                }
            });
    }
});

app.post('/login-user', (req, res) => {
    const { email, password } = req.body;

    container
        .select('name', 'email')
        .where({
            email: email,
            password: password,
        })
        .then((data) => {
            if (data.length) {
                res.json(data[0]);
            } else {
                res.json('Email or password is incorrect');
            }
        });
});

app.listen(403, (req, res) => {
    console.log('listening on 403');
});

I use the following command to allow my JS files to run on the browser. I don't have any issues with the other files. Just this particular one.

"browserify ./application/staging/index-s.js > ./application/deploy/index.js -t babelify --plugin tinyify"

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda