Recently, I delved into the world of TypeScript in VS2015 and so far, it has been a smooth journey. I managed to establish a structure that compiled and performed as anticipated.
However, things took a turn when I attempted to incorporate npm-installed modules.
This snippet functions seamlessly:
import * as fs from 'fs';
The 'fs' module is readily accessible. Yet, upon installing additional modules via npm (such as xml2js), VS 2015 throws an error indicating it does not recognize the module.
import * as xml2js from 'xml2js';
...
Error TS2307 Cannot find module 'xml2js'.
Interestingly, if I navigate to the project folder and execute the CLI command
node app.js
it compiles without any issues. It appears that VS 2015 fails to acknowledge the modules, despite the package.json containing the correct packages.
Furthermore, within the VS 2015 solution viewer, the packages are listed with red circles next to them, as depicted below:
https://i.sstatic.net/cbQ0j.png
Would anyone happen to know the significance of these red circles?
I'm certain I've made an oversight somewhere or missed a crucial step, but unfortunately, my attempts at finding a resolution on Google have been unsuccessful. Any assistance would be greatly appreciated.