Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Unable to serve a multi-apps project

$
0
0

@MarcoMarco wrote:

Hello,

I’m having an issue trying to create and launch a multi-applications project. I’m following the 3 steps from the documentation.

Ionic : v4.12.0
Angular CLI : 7.3.8
Node : 10.15.1
npm : 6.9.0
Windows 10

I create a directory “monorepo”.
In this folder, I create a file ionic.config.json and paste in it the code below:

 {
   "projects": {}
 }

In monorepo, I create a second directory : apps.
In this directory (with the command prompt), I write the command :
ionic start "app1" --no-deps

ionic.config.json is correctly populated with the data:

{
  "projects": {
    "app1": {
      "name": "app1",
      "integrations": {},
      "type": "angular",
      "root": "apps\\app1"
    }
  }
}

Then I try to serve : ionic serve --project app1
And got this error :

> ng run app1:serve --host=0.0.0.0 --port=8100
[ng] Project 'app1' could not be found in workspace.
[ng] Error: Project 'app1' could not be found in workspace.
[ng]     at Workspace.getProject (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\src\workspace\workspace.js:93:19)
[ng]     at Architect.getBuilderConfiguration (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\architect\src\architect-legacy.js:117:41)
[ng]     at RunCommand.runSingleTarget (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:160:45)
[ng]     at RunCommand.runArchitectTarget (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\models\architect-command.js:201:35)
[ng]     at RunCommand.run (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\commands\run-impl.js:14:25)
[ng]     at RunCommand.validateAndRun (C:\Users\name\AppData\Roaming\npm\node_modules\@angular\cli\models\command.js:124:31)
[ng]     at process._tickCallback (internal/process/next_tick.js:68:7)
[ng]     at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
[ng]     at startup (internal/bootstrap/node.js:283:19)
[ng]     at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

[ERROR] ng has unexpectedly closed (exit code 1).

        The Ionic CLI will exit. Please check any output above for error details.

When I go under the file associated with the error (workspace.js:93:19), and I do console.log, I obtain this info:

    getProject(projectName) {
        this._assertLoaded();

        console.log("this.projectName : " + projectName); // this.projectName : app1
        console.log("\n\nthis._workspace.projects : \n");
        console.log(this._workspace.projects); // this._workspace.projects : app and app-e2e

        const workspaceProject = this._workspace.projects[projectName];

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>