Error: Cannot find module 'reflect-metadata' #4478
-
Hi Guys, I'm using docker and adonisjs v5. But a have error message: oms_app_backend | Error: Cannot find module 'reflect-metadata'
oms_app_backend | Require stack:
oms_app_backend | - /home/node/app/ace
oms_app_backend | at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
oms_app_backend | at Module._load (node:internal/modules/cjs/loader:985:27)
oms_app_backend | at Module.require (node:internal/modules/cjs/loader:1235:19)
oms_app_backend | at require (node:internal/modules/helpers:176:18)
oms_app_backend | at Object.<anonymous> (/home/node/app/ace:10:1)
oms_app_backend | at Module._compile (node:internal/modules/cjs/loader:1376:14)
oms_app_backend | at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
oms_app_backend | at Module.load (node:internal/modules/cjs/loader:1207:32)
oms_app_backend | at Module._load (node:internal/modules/cjs/loader:1023:12)
oms_app_backend | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
oms_app_backend | code: 'MODULE_NOT_FOUND',
oms_app_backend | requireStack: [ '/home/node/app/ace' ]
oms_app_backend | }
oms_app_backend |
oms_app_backend | Node.js v20.11.0 Dockerfile
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @zhiephie! 👋🏻 It should be a production dependency. Move it there. |
Beta Was this translation helpful? Give feedback.
-
Hey @RomainLanz, Already production dependency, this is {
"name": "backend-adonis",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "node ace serve --watch",
"build": "node ace build --production",
"start": "node server.js",
"test": "node ace test",
"lint": "eslint . --ext=.ts",
"format": "prettier --write .",
"prepare": "husky install",
"docker:app": "docker exec -it oms_app_backend /bin/sh",
"docker:redis": "docker exec -it redis /bin/sh",
"docker:postgres": "docker exec -it postgres /bin/sh",
"docker:mssql": "docker exec -it sqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P g3bl3kbNer!"
},
"eslintConfig": {
"extends": [
"plugin:adonis/typescriptApp",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error"
]
}
},
"eslintIgnore": [
"build"
],
"prettier": {
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
},
"devDependencies": {
"@adonisjs/ace": "^11.3.1",
"@adonisjs/assembler": "^5.9.6",
"@japa/preset-adonis": "^1.0.1",
"@japa/runner": "^2.5.1",
"@types/proxy-addr": "^2.0.3",
"@types/source-map-support": "^0.5.10",
"@types/uuid": "^9.0.8",
"adonis-preset-ts": "^2.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-adonis": "^2.1.1",
"eslint-plugin-prettier": "^5.1.2",
"husky": "^8.0.0",
"pino-pretty": "^10.3.1",
"prettier": "^3.1.1",
"typescript": "~4.6",
"youch": "^3.3.3",
"youch-terminal": "^2.2.3"
},
"dependencies": {
"@adonisjs/auth": "^8.2.3",
"@adonisjs/core": "^5.9.0",
"@adonisjs/lucid": "^18.4.2",
"@adonisjs/mail": "^8.2.1",
"@adonisjs/redis": "^7.3.4",
"@adonisjs/repl": "^3.1.11",
"@adonisjs/view": "^6.2.0",
"adonis-lucid-filter": "^4.1.1",
"adonis-lucid-soft-deletes": "^1.4.4",
"adonis5-swagger": "^1.4.1",
"cjs": "^0.0.11",
"exceljs": "^4.4.0",
"http-status-codes": "^2.3.0",
"luxon": "^3.4.4",
"node-fetch": "^3.3.2",
"pg": "^8.11.3",
"proxy-addr": "^2.0.7",
"puppeteer": "^22.4.1",
"reflect-metadata": "^0.2.1",
"socket.io": "^4.7.3",
"source-map-support": "^0.5.21",
"ulid": "^2.3.0",
"uuid": "^9.0.1"
}
}
|
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
Hey @zhiephie! 👋🏻
It should be a production dependency. Move it there.