I have an angular project that i tried to convert to a mobile app usinc ionic angular, i replaced the src folder from ionic with the one from my angular project.
Upon using the command: ionic serve, i get the following error:
ionic serve
> ng run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
I tried renaming the project configuration in the angular.json to be called 'app' , instead of the name of the folder that contains my files, but this results in the next errors:
ionic serve
> ng run app:serve --host=localhost --port=8100
[ng] An unhandled exception occurred: Invalid target: {"project":"base","target":"build"}.
[ng] See "/private/var/folders/mk/p7qr28c12pv_j8bmq4xxt__80000gn/T/ng-wxz3VS/angular-errors.log" for further details.
[ERROR] ng has unexpectedly closed (exit code 127).
The Ionic CLI will exit. Please check any output above for error details.
Where base is the name of my folder
In angular.json this is my configuration:
"projects": {
"base": {
"root": "src",
"sourceRoot": "src/base",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": [
"hammerjs",
"rxjs",
"lodash",
"file-saver",
"socket.io-client",
"ng-drag-drop",
"z-schema",
"jexl"
],
"outputPath": "dist",
"index": "src/base/index.html",
"main": "src/base/main.ts",
"tsConfig": "src/base/../tsconfig.app.json",
"polyfills": "src/base/../polyfills.ts",
"assets": [
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
},
{
"glob": "**/*",
"input": "src/base/assets",
"output": "/assets"
}
],
"styles": [
"src/base/assets/styles/styles.scss"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/base/../environments/environment.ts",
"with": "src/base/../environments/environment.prod.ts"
}
]
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "base:build"
},
"configurations": {
"production": {
"browserTarget": "base:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "base:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/base/../test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/base/../polyfills.ts",
"tsConfig": "src/base/../tsconfig.spec.json",
"scripts": [],
"styles": [
"src/base/assets/styles/styles.scss"
],
"assets": [
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
},
{
"glob": "**/*",
"input": "src/base/assets",
"output": "/assets"
}
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
And my directory hierarchy in src is this one File hierarchy