I am new to Typescript and Angular 2. I need to install an npm dependency and use it in my angular 2 app.
The dependency is https://www.npmjs.com/package/ng2-stomp-s
If you are not using new version of angular you can't find typings.d.ts
file in your project. My suggestion is to update your project using angular CLI https://cli.angular.io/
My two cents to this conversation:
In your tsconfig.json file make sure that you have the right path for your typings.d.ts file
"typeRoots": [ "node_modules/@types", "../src/typings.d.ts" ],
It seems like your Typescript compiler tries to compile files from node_modules
directory.
Please make sure you have this excluding rule in your tsconfig.json
file:
{
"compilerOptions": {},
"exclude": [
"node_modules"
]
}
Btw. you need just one of @types
and typings
. The second one is deprecated, all you need is proper @types
packages included in your dev dependencies. Hope it helps!
EDIT: I think there shouldn't be any Typescript files in npm package, so I've created a topic with fix on this repository's github: https://github.com/devsullo/ng2-STOMP-Over-WebSocket/issues/5