The project uses a third party library with no types defined. As the project is developed using Angular CLI (version 1.0.0-beta.29), the library is declared in typings.d.ts. In my case: declare module ‘xml2js-es6-promise’;
Project compiles and is served fine with tsc, but no with ngc. The error trace:
Cannot find module ‘xml2js-es6-promise’
The tscconfig:
{
“compilerOptions”: {
“baseUrl”: “.”,
“declaration”: true,
“stripInternal”: true,
“experimentalDecorators”: true,
“strictNullChecks”: false,
“noImplicitAny”: false,
“module”: “es2015”,
“moduleResolution”: “node”,
“paths”: {
“@angular/core”: [“node_modules/@angular/core”],
“rxjs/*”: [“node_modules/rxjs/*”],
“xml2js-es6-promise”:[“node_modules/xml2js-es6-promise”]
},
“rootDir”: “.”,
“outDir”: “dist”,
“sourceMap”: true,
“inlineSources”: true,
“target”: “es5”,
“skipLibCheck”: true,
“lib”: [
“es2015”,
“dom”
]
},
“files”: [
“index.ts”
],
“angularCompilerOptions”: {
“strictMetadataEmit”: true
}
}