Reputation: 644
While running npm run build on the graphQL files, I am suddenly facing these errors:
error TS2688: Cannot find type definition file for 'content-disposition'. error TS2688: Cannot find type definition file for 'http-errors'. error TS2688: Cannot find type definition file for 'nodemailer'. error TS2688: Cannot find type definition file for 'qs'.
Here is my package.json
"name": "b2e-graphql-api",
"version": "0.0.1",
"description": "",
"author": "",
"license": "MIT",
"scripts": {
"prebuild": "rimraf dist",
"build:dev": "nest build && cp -R schema/ dist && cp package.json dist",
"build:stage": "nest build && cp -R schema/ dist && cp package.json dist",
"build:qa": "nest build && cp -R schema/ dist && cp package.json dist",
"build": "nest build && cp -R schema/ dist",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"codegen": "graphql-codegen",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^6.10.14",
"@nestjs/core": "^6.10.14",
"@nestjs/graphql": "^6.6.2",
"@nestjs/platform-express": "^6.10.14",
"apollo-datasource-rest": "^0.8.0",
"apollo-server": "^2.11.0",
"dataloader": "2.0.0",
"dotenv": "^8.2.0",
"graphql": "^14.6.0",
"graphql-codegen": "^0.4.0",
"graphql-tools": "^4.0.7",
"html-minifier": "^4.0.0",
"jsonwebtoken": "^8.5.1",
"mobile-detect": "^1.4.4",
"npm": "^7.5.6",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.0",
"rxjs": "^6.5.4",
"winston": "^3.3.3"
},
"devDependencies": {
"@graphql-codegen/cli": "^1.19.2",
"@graphql-codegen/typescript": "^1.17.0",
"@nestjs/cli": "^6.13.2",
"@nestjs/schematics": "^6.8.1",
"@nestjs/testing": "^6.10.14",
"@types/express": "^4.17.2",
"@types/jest": "25.1.2",
"@types/node": "^13.1.6",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"supertest": "^4.0.2",
"ts-jest": "25.2.0",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.7.4"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
Upvotes: 0
Views: 651
Reputation: 1075
You must install the type definition. To achieve that
npm install --save @types/http-errors
npm install --save @types/nodemailer
npm install --save @types/qs
npm install --save @types/content-disposition
in your project folder, if you are using npm.
Upvotes: 1