I've been asked to make changes to a TypeScript project and compile it to get a new JavaScript file. The JavaScript file is just to be referenced from a SharePoint site, so there's no SPFx involved here.
I downloaded the project from our TFS and did an "npm install" to get the node modules and that worked fine.
When I try to build it using "npm run-script build" I get a bunch of errors regarding sp-pnp-js. According to package.json, this is the version referenced:
"sp-pnp-js": "^2.0.5"
See the errors below. I'm completely at a loss here and I don't understand the errors. I know that the code is okay, so this is something wrong in my dev environment. What am I missing? Please help.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/attachmentfiles.d.ts:71:5
TS2416: Property 'delete' in type 'AttachmentFile' is not assignable to the same property in base type 'QueryableInstance'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/files.d.ts:114:5
TS2416: Property 'delete' in type 'File' is not assignable to the same property in base type 'QueryableShareableFile'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/files.d.ts:286:5
TS2416: Property 'delete' in type 'Version' is not assignable to the same property in base type 'QueryableInstance'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/folders.d.ts:81:5
TS2416: Property 'delete' in type 'Folder' is not assignable to the same property in base type 'QueryableShareableFolder'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/items.d.ts:112:5
TS2416: Property 'delete' in type 'Item' is not assignable to the same property in base type 'QueryableShareableItem'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.
ERROR in [at-loader] ./node_modules/sp-pnp-js/lib/sharepoint/lists.d.ts:151:5
TS2416: Property 'delete' in type 'List' is not assignable to the same property in base type 'QueryableSecurable'.
Type '(eTag?: string) => Promise<void>' is not assignable to type '(deleteOptions?: FetchOptions, parser?: ODataParser<any>) => Promise<any>'.
Types of parameters 'eTag' and 'deleteOptions' are incompatible.
Type 'FetchOptions' is not assignable to type 'string'.