Error posting nodejs app to heruko (internal / modules / cjs / loader.js: 582 ... throw err; ... Error: Can not find module '../constants')

0

I have the following problem: I have an api in nodeJS V10.14, I'm hosting it in heroku, at first everything was fine, but a day ago I deployed and gave me the following error (heroku log):

in the index.js file I have the following.

'use strict'
var config = require("./settings/config");
var mongoose = require('mongoose');
var uri = config.db.host;
var app = require('./app');
var port = process.env.PORT || config.app.port;
mongoose.connect(uri, { useNewUrlParser: true })
.then(
  ()=>{
    console.log(config.statup_messages.CONECTION_READY);
    app.listen(port,()=>
    {
      console.log(config.statup_messages.SERVER_RUNNING);
    });
  }
).catch(
  (err) => {console.log(err);}
);

I comment that the module that shows that according to does not find, I do not use it (../ contants), I want to suppose that it is some dependency of some package. Has this happened to someone? I have already created a new site in heroku, I have executed npm install or npm update , delete node_modules , but the error continues. When I run the application locally I do not find any exception (as always), the problem is when performing the deploy Thank you very much friends in advance. I describe packages.json

{
  "name": "backend",
  "version": "1.0.0",
  "description": "****",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Rosel Mende",
  "license": "ISC",
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.18.3",
    "connect-multiparty": "^2.2.0",
    "express": "^4.16.4",
    "jwt-simple": "^0.5.5",
    "moment": "^2.22.2",
    "mongoose": "^5.3.5",
    "uuid": "^3.3.2"
  },
  "devDependencies": {
    "nodemon": "^1.18.7"
  }
}
    
asked by Rosell Mendez 05.12.2018 в 04:29
source

0 answers