Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Unable compile a TypeScript project using this #318

Open
stephenmathieson opened this issue Jun 30, 2022 · 1 comment
Open

Unable compile a TypeScript project using this #318

stephenmathieson opened this issue Jun 30, 2022 · 1 comment

Comments

@stephenmathieson
Copy link

Trying to run the TypeScript compiler on a file that uses this module yields many errors about request-promise. Adding @types/request-promise does not fix it.

Example:

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2019",
    "outDir": "./dist",
    "module": "commonjs",
    "moduleResolution": "node",
    "esModuleInterop": true,
    "noImplicitAny": true,
    "skipLibCheck": true
  },
  "include": ["src/"]
}

src/thing.ts

import Hubspot from "hubspot";

const h = new Hubspot({ apiKey: "abc" });

h.contacts.create({});
Error logs
$ tsc
�[96mnode_modules/hubspot/lib/typescript/broadcast.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/campaign.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/company.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/company_property.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/company_property_group.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/contact.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/contact_property.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/crm_associations.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/deal.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/deal_property.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/deal_property_group.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/emails.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/engagement.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/file.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/form.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/integrations.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/list.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/marketing_email.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/oauth.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/owner.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/page.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/pipeline.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/subscription.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/ticket.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/timeline.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m

�[96mnode_modules/hubspot/lib/typescript/workflow.ts�[0m:�[93m1�[0m:�[93m32�[0m - �[91merror�[0m�[90m TS7016: �[0mCould not find a declaration file for module 'request-promise'. '/private/var/folders/rv/7q3pn2c94pbf82592qpt1w2m0000gq/T/hubspot-ts-test/node_modules/request-promise/lib/rp.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/request-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'request-promise';`

�[7m1�[0m import { RequestPromise } from 'request-promise'
�[7m �[0m �[91m                               ~~~~~~~~~~~~~~~~~�[0m


Found 26 errors in 26 files.

Errors  Files
     1  node_modules/hubspot/lib/typescript/broadcast.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/campaign.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/company.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/company_property.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/company_property_group.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/contact.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/contact_property.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/crm_associations.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/deal.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/deal_property.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/deal_property_group.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/emails.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/engagement.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/file.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/form.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/integrations.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/list.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/marketing_email.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/oauth.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/owner.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/page.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/pipeline.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/subscription.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/ticket.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/timeline.ts�[90m:1�[0m
     1  node_modules/hubspot/lib/typescript/workflow.ts�[90m:1�[0m
@OakBehringer
Copy link

yarn add @types/request-promise --dev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants