nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.63k stars 2.36k forks source link

Convert Angular 4.4 SPA to Nx Workspace fails #235

Closed xeax closed 6 years ago

xeax commented 6 years ago
F:\nrwl>ng generate workspace app1 --collection=@nrwl/schematics
Schematic "workspace" not found in collection "@schematics/angular".
Error: Schematic "workspace" not found in collection "@schematics/angular".
    at BaseException (F:\nrwl\node_modules\@angular-devkit\schematics\src\exception\exception.js:12:9)
    at UnknownSchematicException (F:\nrwl\node_modules\@angular-devkit\schematics\src\engine\engine.js:27:9)
    at SchematicEngine.createSchematic (F:\nrwl\node_modules\@angular-devkit\schematics\src\engine\engine.js:65:19)
    at CollectionImpl.createSchematic (F:\nrwl\node_modules\@angular-devkit\schematics\src\engine\collection.js:11:29)
    at Object.getSchematic (F:\nrwl\node_modules\@angular\cli\utilities\schematics.js:40:23)
    at Class.run (F:\nrwl\node_modules\@angular\cli\tasks\schematic-run.js:19:40)
    at Class.run (F:\nrwl\node_modules\@angular\cli\commands\generate.js:138:33)
    at resolve (F:\nrwl\node_modules\@angular\cli\ember-cli\lib\models\command.js:273:20)
    at Class.validateAndRun (F:\nrwl\node_modules\@angular\cli\ember-cli\lib\models\command.js:251:12)
    at Promise.resolve.then.then (F:\nrwl\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:154:24)

package.json

{
  ....
  "dependencies": {
    "@angular/animations": "4.4.3",
    "@angular/cdk": "2.0.0-beta.11",
    "@angular/common": "4.4.3",
    "@angular/compiler": "4.4.3",
    "@angular/core": "4.4.3",
    "@angular/flex-layout": "2.0.0-beta.9",
    "@angular/forms": "4.4.3",
    "@angular/http": "4.4.3",
    "@angular/material": "2.0.0-beta.11",
    "@angular/platform-browser": "4.4.3",
    "@angular/platform-browser-dynamic": "4.4.3",
    "@angular/router": "4.4.3",
    "@swimlane/ngx-dnd": "3.0.0",
    "angular-calendar": "0.19.0",
    "angular-in-memory-web-api": "0.4.6",
    "angular-oauth2-oidc": "3.0.3",
    "angular2-text-mask": "8.0.4",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.0",
    "d3": "4.10.0",
    "file-saver": "1.3.3",
    "hammerjs": "2.0.8",
    "highlight.js": "9.12.0",
    "intl": "1.2.5",
    "md2": "0.0.28",
    "moment": "2.18.1",
    "ng-block-ui": "1.0.0-beta.16",
    "ngx-cookie-service": "1.0.7",
    "ngx-perfect-scrollbar": "4.6.2",
    "perfect-scrollbar": "0.8.1",
    "rxjs": "5.4.3",
    "text-mask-addons": "3.7.1",
    "web-animations-js": "2.3.1",
    "xlsx": "0.11.14",
    "zone.js": "0.8.17"
  },
  "devDependencies": {
    "@angular/cli": "1.4.2",
    "@angular/compiler-cli": "4.4.3",
    "@angular/language-service": "4.4.3",
    "@angularclass/hmr": "2.1.3",
    "@ngtools/webpack": "1.7.1",
    "@nrwl/schematics": "0.6.19",
    "@types/jasmine": "2.6.0",
    "@types/jasminewd2": "2.0.2",
    "@types/node": "6.0.88",
    "codelyzer": "3.0.1",
    "jasmine-core": "2.6.2",
    "jasmine-spec-reporter": "4.1.0",
    "karma": "1.7.1",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.2.1",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "node-sass": "4.5.3",
    "protractor": "5.1.2",
    "ts-node": "3.0.4",
    "tslint": "5.3.2",
    "typescript": "2.3.3"
  }
xeax commented 6 years ago

Same error on @nrwl/schematics@0.7.0-beta.1 or @nrwl/schematics@0.7.0-beta.3

xeax commented 6 years ago

Issue solved with: npm install --save-dev @angular/cli@1.4.10

May need remove old version of @ngtools/webpack from package.json.

This versions of nrwl/schematics works fine for my case: @nrwl/schematics@0.7.0-beta.1 @nrwl/schematics@0.6.19

vsavkin commented 6 years ago

You have to use the newer version of the CLI. The older one didn't support custom collections. I'll update the docs to mention it.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.