openschift 서버에 내 node.js 프로젝트를 배포하려고합니다. 내 프로젝트가 내 로컬 시스템에서 제대로 실행되지만 서버에 배포 할 때 다음과 같이 불평합니다. 다음내 프로젝트가 서버에 배포 될 때 반영되지 않음
내가 파일을 추적하고는 나는 그것이 내가 생각 코드 라이브러리 대에 lib.es6.d.ts에서 그것을 읽는 것을 볼 수있다 반영에서 얻을 않는 경우 보려고 VS 코드에/opt/app-root/src/node_modules/inversify/lib/annotation/decorator_utils.js:22
if (Reflect.hasOwnMetadata(metadataKey, annotationTarget) === true) {
^
ReferenceError: Reflect is not defined
at _tagParameterOrProperty (/opt/app-root/src/node_modules/inversify/lib/annotation/decorator_utils.js:22:9)
at Object.tagProperty (/opt/app-root/src/node_modules/inversify/lib/annotation/decorator_utils.js:12:5)
at /opt/app-root/src/node_modules/inversify/lib/annotation/inject.js:13:31
at __decorate (/opt/app-root/src/node_modules/inversify-express-utils/lib/base_http_controller.js:5:110)
at /opt/app-root/src/node_modules/inversify-express-utils/lib/base_http_controller.js:17:5
at Object.<anonymous> (/opt/app-root/src/node_modules/inversify-express-utils/lib/base_http_controller.js:25:2)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
해당 파일을 서버에서 사용할 수 없지만 어떻게 서버에 포함시킬 수 있는지 잘 모르겠습니다.
편집 1 : 내가 고정 표시기 내 package.js을 사용하지 않는은 다음과 같다 :
{
"name": "mmm",
"version": "1.0.0",
"description": "",
"main": "build/bootstrap.js",
"scripts": {
"compile": "tsc --declaration && node build/bootstrap.js",
"dev": "nodemon -e ts --exec \"npm run compile\"",
"start": "nodemon -e ts --exec \"npm run compile\"",
"tsc": "tsc",
"tsc:w": "tsc -w"
},
"author": "mmmm",
"license": "ISC",
"dependencies": {
"@types/body-parser": "^1.16.5",
"@types/express": "^4.0.39",
"@types/node": "^8.0.44",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"commander": "^2.12.2",
"deep-diff": "^0.3.8",
"express": "^4.16.2",
"fs-finder": "^1.8.1",
"inversify": "^4.5.2",
"inversify-express-utils": "^4.0.1",
"keypress": "^0.2.1",
"knex": "^0.13.0",
"mysql": "^2.15.0",
"pg": "^7.3.0",
"reflect-metadata": "^0.1.10",
"request": "^2.83.0",
"tape": "^4.8.0",
"typeorm": "^0.1.1"
},
"devDependencies": {
"nodemon": "^1.12.1",
"typescript": "^2.6.2"
}
}
내 tsconfig.json은 다음 방법에 많이 의존
{
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"types": ["reflect-metadata"],
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"outDir": "build",
"declarationDir": "declaration",
"watch": false
},
"exclude": [
"node_modules",
"build",
"declaration"
]
}
고마워요! 그래, 다른 곳에서 가져 와서 응용 프로그램 부트 스트랩 파일에만 배치하고 오류가 사라졌지 만 로컬 컴퓨터에있을 때 불평하지 않는 이유가 궁금합니다. – user4092086
아마 클라이언트와 서버 측이 다를 수도있는 빌드 논리와 관련이 있습니다 ... –