Trying to start a fresh Angular 5 project, I have successfully installed @angular/cli version 1.6.3 and ran the following commands:
ng new project --routing
Post installation, I proceeded with the commands:
cd project
ng build
However, encountered the following errors:
Module build failed: Error: d:...\project\src\main.ts is missing from the TypeScript compilation. Please ensure it is included in your tsconfig file under 'files' or 'include' property.
Module build failed: Error: d:...\project\src\polyfills.ts is missing from the TypeScript compilation. Make sure it is added to your tsconfig via the 'files' or 'include' property.
There are discussions regarding this issue on the Angular Github page, but the resolution provided did not prove helpful besides mentioning that it has been resolved or pointing out instances of .ts files in node_modules.
The Windows 10 operating system is being used here.
EDIT: Here are the contents of the two tsconfig files:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
The other (src/tsconfig.app.json):
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Both these configurations were generated using ng new
.