简体   繁体   English

Elastic Beanstalk“错误 TS2688:找不到‘节点’的类型定义文件。”

[英]Elastic Beanstalk "error TS2688: Cannot find type definition file for 'node'."

I'm trying to deploy an app to elastic beanstalk's NodeJs Platform (10.15.3) but as it builds (the Node commmand is npm start --production ) I'm seeing the following errors in logs:我正在尝试将应用程序部署到弹性 beantalk 的 NodeJs 平台 (10.15.3),但在构建时(节点命令为npm start --production )我在日志中看到以下错误:

npm run build
app@1.0.0 build /var/app/current
tsc -p .
error TS2688: Cannot find type definition file for 'node'.

My package.json is the following (it includes @type/node:10.14):我的 package.json 如下(它包括 @type/node:10.14):

{
  "name": "app",
  "version": "1.0.0",
  "private": true,
  "main": "dist/app.js",
  "scripts": {
    "build": "tsc -p .",
    "prestart": "npm run build",
    "watch": "tsc -w -p .",
    "start": "node .",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "@types/morgan": "^1.7.35",
    "@types/node": "^10.14",
    "aws-sdk": "^2.411.0",
    ...
  },
  "devDependencies": {
    "@types/express": "^4.16.1"
  }
}

You should add types to your tsconfig.json您应该将类​​型添加到您的tsconfig.json

 {
   "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "outDir": "dist-api",
      "sourceMap": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "types": ["node"]
   },
   "include": [
      "src/**/*.ts"
   ],
   "exclude": [
      "node_modules"
   ]
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “找不到‘async’的类型定义文件。TS2688” - "Cannot find type definition file for 'async'. TS2688" TS2688:找不到安装了@ types / node的“ node”的类型定义文件 - TS2688: Cannot find type definition file for 'node' with @types/node installed 打字稿错误TS2688:找不到“ .AppleDouble”的类型定义文件 - Typescript error TS2688: Cannot find type definition file for '.AppleDouble' ../node_modules/ng2-ckeditor/ckbutton 中的错误。 指令.d.TS:1:23 - 错误 TS2688:找不到“ckeditor”的类型定义文件 - ERROR in ../node_modules/ng2-ckeditor/ckbutton. directive.d.TS: 1:23 - error TS2688: Cannot find type definition file for 'ckeditor' 构建:找不到“节点”的类型定义文件 - Build:Cannot find type definition file for 'node' 找不到“节点”的类型定义文件 - Cannot find type definition file for 'node' NodeJS Elastic Beanstalk 环境报错 Cannot find module 'node-linux-arm64/package.json' - NodeJS Elastic Beanstalk environment error Cannot find module 'node-linux-arm64/package.json' 在 heroku 节点上编译 ts-jest types-找不到类型定义 - Compile on heroku node ts- jest types- cannot find type definition npm install => 找不到“节点”的类型定义文件 - npm install => Cannot find type definition file for 'node' Elastic Beanstalk上传和部署错误:错误:找不到模块“ semver” - Elastic Beanstalk upload and deploy error: Error: Cannot find module 'semver'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM