Olá, estou tendo dificuldades em hospedar meu WebApp na umbler, nos logs recebo a seguinte mensagem:
Mar 11 14:16:20 > node ./src/main.js
Mar 11 14:16:20 > 0001@1.0.0 start /usr/src/app
Mar 11 14:16:20
Mar 11 14:16:12 npm ERR! /usr/src/app/.npm/_logs/2020-03-11T17_16_12_767Z-debug.log
Mar 11 14:16:12 npm ERR! A complete log of this run can be found in:
Mar 11 14:16:12
Mar 11 14:16:12 npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Mar 11 14:16:12 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Mar 11 14:16:12 npm ERR! Failed at the 0001@1.0.0 start script.
Mar 11 14:16:12 npm ERR!
Mar 11 14:16:12 npm ERR! Exit status 1
Mar 11 14:16:12 npm ERR! 0001@1.0.0 start: node ./src/main.js
Mar 11 14:16:12 npm ERR! errno 1
Mar 11 14:16:12 npm ERR! code ELIFECYCLE
Mar 11 14:16:12 at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Mar 11 14:16:12 at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Mar 11 14:16:12 at Module.load (internal/modules/cjs/loader.js:653:32)
Mar 11 14:16:12 at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
Mar 11 14:16:12 at Module._compile (internal/modules/cjs/loader.js:778:30)
Mar 11 14:16:12 at Object. (/usr/src/app/src/main.js:37:17)
Mar 11 14:16:12 at require (internal/modules/cjs/helpers.js:25:18)
Mar 11 14:16:12 at Module.require (internal/modules/cjs/loader.js:692:17)
Mar 11 14:16:12 at Function.Module._load (internal/modules/cjs/loader.js:562:25)
Mar 11 14:16:12 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
Mar 11 14:16:12 Error: Cannot find module ‘express’
Mar 11 14:16:12
Mar 11 14:16:12 ^
Mar 11 14:16:12 throw err;
Mar 11 14:16:12 internal/modules/cjs/loader.js:638
Mar 11 14:16:12 Server stared on http://localhost:3180
meu package.json:
{
“name”: “0001”,
“version”: “1.0.0”,
“description”: “”,
“main”: “main.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”,
“start”: “node ./src/main.js”
},
“keywords”: [],
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“body-parser”: “^1.19.0”,
“express”: “^4.17.1”,
“express-handlebars”: “^3.1.0”,
“mariadb”: “^2.2.0”,
“mysql2”: “^2.1.0”,
“sequelize”: “^5.21.5”
}
}
Neste trecho do log:
Mar 11 14:16:12 Error: Cannot find module ‘express’
Está claro que o problema é com os módulos do Node, porém ao executar a aplicação após o “node install” localmente tudo funciona normalmente.