Vikram R
Vikram R

Reputation: 776

include multiple node_modules in tsconfig.json

I am using Migrating Angular 4.x to Angular 5 my project. I have faced

ERROR in ./node_modules/api-ai-javascript/index.ts 

So i changed in tsconfig.json added below changes,

"include": [
    "src/**/*",
    "node_modules/api-ai-javascript/index.ts"
  ]

Still getting /node_modules/ng2-stomp-service/dist/stomp.service.ts How to added include multiple node_modules?

EDITED:

 "include": [
    "src/**/*",
    {"node_modules/api-ai-javascript/index.ts"},
    {"node_modules/ng2-stomp-service/dist/stomp.service.ts"},
  ]

Getting expected token } in JSON at position 439.

Upvotes: 7

Views: 13524

Answers (2)

David
David

Reputation: 34475

Regarding the invalid json, it's because "include" must be an array of strings. Try that

"include": [
    "src/**/*",
    "node_modules/api-ai-javascript/index.ts",
    "node_modules/ng2-stomp-service/dist/stomp.service.ts"
]

Upvotes: 10

Daniel Mattsson
Daniel Mattsson

Reputation: 676

Getting expected token } in JSON at position 439.

This means that something is wrong in the JSON file. Most likely it's the last comma after stomp.service.ts"} in

 "include": [
    "src/**/*",
    {"node_modules/api-ai-javascript/index.ts"},
    {"node_modules/ng2-stomp-service/dist/stomp.service.ts"},
  ]

Upvotes: -6

Related Questions