angular-architects / module-federation-plugin

MIT License
713 stars 191 forks source link

Unable to resolve @angular-architects/module-federation@next:ng-add. #91

Open muffrank opened 2 years ago

muffrank commented 2 years ago

I am adding @angular-architects/module-federation@next into an NX Project and this is my package.json file { "name":"ems-mfe", "version":"0.0.0", "license":"MIT", "scripts":{ "ng":"nx", "postinstall":"node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main", "start":"nx serve", "build":"nx build", "test":"nx test" }, "private":true, "dependencies":{ "@angular-architects/module-federation":"^12.3.0-beta.3", "@angular/animations":"^12.1.3", "@angular/cdk":"^12.1.3", "@angular/common":"^12.1.3", "@angular/compiler":"^12.1.3", "@angular/core":"^12.1.3", "@angular/flex-layout":"^10.0.0-beta.32", "@angular/forms":"^12.1.3", "@angular/material":"^12.1.3", "@angular/platform-browser":"^12.1.3", "@angular/platform-browser-dynamic":"^12.1.3", "@angular/router":"^12.1.3", "@ngmodule/material-carousel":"^0.6.0", "@ngneat/content-loader":"^6.1.0", "@nrwl/angular":"12.10.0", "@sentry/angular":"^6.13.3", "@sentry/tracing":"^6.13.3", "@types/highcharts":"^5.0.22", "@types/socket.io-client":"^1.4.32", "@types/underscore":"^1.8.8", "angular-highcharts":"^10.0.1", "depcheck":"^1.4.2", "fate-editor":"^2.3.5", "highcharts":"^8.1.2", "jquery":"^3.5.1", "moment":"^2.29.1", "ng-click-outside":"^8.0.0", "ng-mat-carousel":"^0.11.1", "ngx-barcode":"^0.3.0", "ngx-daterangepicker-material":"^5.0.0", "ngx-dropzone":"^3.0.0", "ngx-mask":"^11.1.5", "ngx-quicklink":"^0.2.7", "query-string":"^7.0.0", "rxjs":"^6.6.3", "rxjs-compat":"^6.5.5", "socket.io":"^2.1.1", "socket.io-client":"^2.1.1", "subsink":"^1.0.0", "tslib":"^2.0.0", "web-animations-js":"^2.3.2", "yo":"^3.1.1", "zone.js":"~0.11.4" }, "devDependencies":{ "@angular-devkit/build-angular":"^12.1.3", "@angular-eslint/eslint-plugin":"~12.3.0", "@angular-eslint/eslint-plugin-template":"~12.3.0", "@angular-eslint/template-parser":"~12.3.0", "@angular/cli":"^12.1.3", "@angular/compiler-cli":"^12.1.3", "@angular/language-service":"^12.1.3", "@nrwl/cli":"13.0.1", "@nrwl/cypress":"13.0.1", "@nrwl/eslint-plugin-nx":"13.0.1", "@nrwl/jest":"13.0.1", "@nrwl/linter":"13.0.1", "@nrwl/tao":"13.0.1", "@nrwl/workspace":"13.0.1", "@types/jasmine":"~3.6.0", "@types/jasminewd2":"~2.0.3", "@types/jest":"27.0.2", "@types/jquery":"^3.3.21", "@types/node":"14.14.33", "@typescript-eslint/eslint-plugin":"~4.33.0", "@typescript-eslint/parser":"~4.33.0", "babel-core":"^6.26.3", "babel-jest":"^26.6.3", "babel-polyfill":"^6.26.0", "babel-preset-env":"^1.7.0", "babel-preset-react":"^6.24.1", "cypress":"^8.3.0", "eslint":"7.32.0", "eslint-config-prettier":"8.1.0", "eslint-plugin-cypress":"^2.10.3", "hard-source-webpack-plugin":"^0.12.0", "html-webpack-plugin":"^3.2.0", "jasmine-core":"~3.6.0", "jasmine-spec-reporter":"~5.0.0", "jest":"27.2.3", "jest-preset-angular":"10.0.1", "ng-packagr":"^12.1.1", "node-gyp":"^5.0.2", "postcss":"^7.0.5", "postcss-import":"^12.0.0", "postcss-loader":"^3.0.0", "postcss-nested":"^4.1.0", "postcss-preset-env":"^6.2.0", "prettier":"^2.3.1", "protractor":"~7.0.0", "stylelint":"^13.6.1", "stylelint-config-sass-guidelines":"^5.2.0", "stylelint-config-standard":"^18.2.0", "stylelint-order":"^1.0.0", "stylelint-scss":"^3.1.0", "stylelint-webpack-plugin":"^0.10.5", "ts-jest":"27.0.5", "ts-node":"~7.0.1", "tslint":"~6.1.0", "tslint-config-airbnb":"^5.9.2", "tslint-loader":"^3.6.0", "typescript":"~4.3.5", "webpack":"^5.0.0", "webpack-cli":"^3.3.12", "webpack-dev-server":"^3.11.0" } } and I am getting this error

`yarn run v1.22.11 $ /home/umar/codebase/ems-mfe/node_modules/.bin/nx g @angular-architects/module-federation@next:ng-add Unable to resolve @angular-architects/module-federation@next:ng-add. Cannot find module '@angular-architects/module-federation@next/package.json' Require stack:

Error: Command failed: yarn add @angular-architects/module-federation@next && yarn nx g @angular-architects/module-federation@next:ng-add at checkExecSyncError (node:child_process:826:11) at Object.execSync (node:child_process:900:15) at /home/umar/codebase/ems-mfe/node_modules/@nrwl/cli/lib/init-local.js:73:41 at processTicksAndRejections (node:internal/process/task_queues:96:5) { status: 1, signal: null, output: [ null, null, null ], pid: 191220, stdout: null, stderr: null } `

Command that I run: ng add @angular-architects/module-federation@next

dragonflypl commented 2 years ago

@manfredsteyer - I have the same issue. Easy to reproduce:

Thanks for support :)

amanjangra3pg commented 2 years ago

I am also getting the same error, just followed the steps and I am getting the same error

Harsh0721 commented 2 years ago

did you find a solution?

Faizou-Aremou commented 1 year ago

i have same issue

AKraushan commented 7 months ago

Hi all,

I am very new to the micro frontend and I am trying to set up an Angular project with the micro frontend but I struct with the bellow issue can anyone suggest me the solution of it.

I am doing the following steps for setting it up:

Step 1:-

ng new mono-workspace --create-application=false

Step 2:-

ng g application host-app --routing --style=scss --standalone=false

Step 3:-

ng g application mfe-app --routing --style=scss --standalone=false

Step 4:-

npm i wbepack webpack-cli --save-dev

Step 5:-

ng add @angular-architects/module-federation --project host-app --port 4200

After hitting #step 5 command I'm getting this issue

=========================================================== i Using package manager: npm √ Found compatible package version: @angular-architects/module-federation@17.0.6. √ Package information loaded.

The package @angular-architects/module-federation@17.0.6 will be installed and executed. Would you like to proceed? Yes √ Packages successfully installed. Cannot read properties of null (reading 'version')