This problem has long bothered me but I am at a loss as to why. I seem to always be fighting with node_modules. This isn't a @types issue. I am trying to use TypeScript NPM Libraries which already have types.
A great example of this is font awesome. I follow the guide.
npm install @fortawesome/fontawesome-svg-core --save
It tell me that I should then go ahead and configure it using this syntax.
import { library, dom } from '@fortawesome/fontawesome-svg-core';
To which TypeScript informs me that this isn't a module.
I always have to resort to dirty paths like this:
import { library, dom } from '../node_modules/@fortawesome/fontawesome-svg-core/index';
Why does this work for everyone apart from myself?
Here is my tsconfig
{
"compileOnSave": true,
"compilerOptions": {
"sourceMap": true,
"allowJs": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"declaration": false,
"declarationMap": false,
"diagnostics": true,
"removeComments": true,
"module": "es6",
"target": "es5",
"strict": false
},
"include": [
"src/**/*"
]
}
"moduleResolution": "node"tocompilerOptions