Как только я создаю приложение из loopback 4 cli, при выполнении команды npm run migrate
после npm run build
я получаю сообщение об ошибке
Migrating schemas (alter existing schema)
Cannot migrate database schema Error: Timeout in connecting after 5000 ms
at Timeout._onTimeout (/home/manthan/Desktop/temp/temp/node_modules/loopback-datasource-juggler/lib/datasource.js:2654:10)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! temp@1.0.0 migrate: `node ./dist/migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the temp@1.0.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/manthan/.npm/_logs/2020-05-22T06_41_17_958Z-debug.log
Конфигурация источника данных верна, и если я запускаю тот же код на другом система работает достаточно хорошо, как и хотелось.
Пакет. json следующим образом
{
"name": "temp",
"version": "1.0.0",
"description": "temp",
"keywords": [
"loopback-application",
"loopback"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10"
},
"scripts": {
"build": "lb-tsc",
"build:watch": "lb-tsc --watch",
"lint": "npm run prettier:check && npm run eslint",
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
"prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"",
"prettier:check": "npm run prettier:cli -- -l",
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"test": "lb-mocha --allow-console-logs \"dist/__tests__\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"docker:build": "docker build -t temp .",
"docker:run": "docker run -p 3000:3000 -d temp",
"migrate": "node ./dist/migrate",
"prestart": "npm run build",
"start": "node -r source-map-support/register .",
"clean": "lb-clean dist *.tsbuildinfo .eslintcache"
},
"repository": {
"type": "git"
},
"author": "",
"license": "",
"files": [
"README.md",
"dist",
"src",
"!*/__tests__"
],
"dependencies": {
"@loopback/boot": "^2.3.1",
"@loopback/context": "^3.8.1",
"@loopback/core": "^2.7.0",
"@loopback/openapi-v3": "^3.4.1",
"@loopback/repository": "^2.5.1",
"@loopback/rest": "^5.0.1",
"@loopback/rest-explorer": "^2.2.2",
"@loopback/service-proxy": "^2.3.0",
"loopback-connector-postgresql": "^3.9.1",
"tslib": "^1.10.0"
},
"devDependencies": {
"@loopback/build": "^5.4.1",
"source-map-support": "^0.5.19",
"@loopback/testlab": "^3.1.5",
"@types/node": "^10.17.24",
"@loopback/eslint-config": "^7.0.1",
"eslint": "^7.0.0",
"typescript": "~3.9.3"
}
}