When attempting to construct an Angular project, I am encountering the following problem:
The file '/angular/src/environments/environment.ts' is not recognized as a module
I am importing the file in this manner :
import { environment } from '../../environments/environment';
This is what my tsconfig.json
looks like :
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
Within my environment folder, I have the following files: environment.ts
, environment.prod.ts
, environment.dev.ts
.
I am utilizing NODE_VERSION=10 and NG_CLI_VERSION=8
In my angular.json, the configuration for development build is as follows :
"dev": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true
}
The command used for building is :
"build": "ng build --configuration=dev --aot",
Your assistance is greatly appreciated. Thank you in advance!