nrwl / nx

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

Error Converting an Existing Angular 6 App #471

Closed mainawycliffe closed 5 years ago

mainawycliffe commented 6 years ago

I am trying to convert an existing angular 6 application and am getting the following error:

Schematic input does not validate against the Schema: {"dryRun":false,"collection":"@nrwl/schematics","skipInstall":false,"linkCli":false,"skipGit":false,"commit":null}
Errors:

Data path "" should have required property 'name'.
vivekgs2007 commented 6 years ago

Same for me. Any Fix?

mainawycliffe commented 6 years ago

No fix, I gave up and am now trying the new Angular CLI Workspaces.

rhutchison commented 6 years ago

ng generate workspace workspace-name --collection=@nrwl/schematics generates same error

beeman commented 6 years ago

The error is relatively clear: Data path "" should have required property 'name'. means you need to pass in a --name parameter.

I just ran a test, this is how I converted a NG6 project into a Nrwl project:

$ ng new nx-test
$ cd nx-test/
$ yarn add @nrwl/schematics@next
sandangel commented 6 years ago

ok, my problem is when I try with ng add @nrwl/schematics, the npm spin forever and the CPU just goes crazy, I can't even terminate the process with ctrl c, then I had to close the terminal window. The same problem when I try with npm install -D @nrwl/schematics@6.0.2.

UPDATE: OS: macOS HS latest node 10.2 npm 6.1

successfully install with yarn though

FrozenPandaz commented 6 years ago

Was there an error when doing ng add @nrwl/schematics?

There is an existing issue #513 in the latest released version (6.0.2) but there is already a fix for it.

@sandangel What is your environment? OS: npm -v: node -v:

sandangel commented 6 years ago

@FrozenPandaz I guess you have published it using yarn? check this issue https://github.com/yarnpkg/yarn/issues/1619

daBishMan commented 6 years ago

I am struggling creating a new work space with the latest CLI and latest nx

$ ng -v
Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.8
@angular-devkit/core         0.6.8
@angular-devkit/schematics   0.6.8
@schematics/angular          0.6.8
@schematics/update           0.6.8
rxjs                         6.2.1
typescript                   2.7.2

I am trying to generate a new work space I get

$ ng new myworkspacename --collection=@nrwl/schematics
Could not find module "@ngrx/schematics" from "C:\\daCode\\daPlay".
Error: Could not find module "@ngrx/schematics" from "C:\\daCode\\daPlay".
    at Object.resolve (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\core\node\resolve.js:141:11)
    at NodeModulesEngineHost._resolvePackageJson (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:28:21)
    at NodeModulesEngineHost._resolveCollectionPath (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:69:40)
    at NodeModulesEngineHost.createCollectionDescription (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:106:27)
    at SchematicEngine._createCollectionDescription (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:78:40)
    at SchematicEngine._createCollectionDescription (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:89:48)
    at SchematicEngine.createCollection (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:71:43)
    at Object.getCollection (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\utilities\schematics.js:28:31)
    at NewCommand.getOptions (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\models\schematic-command.js:193:41)
    at NewCommand.initialize (C:\Users\jaybi\AppData\Roaming\npm\node_modules\@angular\cli\commands\new.js:48:21)

I have both the cli and nx are installed globally

$ npm list -g --depth=0
C:\Users\jaybi\AppData\Roaming\npm
+-- @angular/cli@6.0.8
+-- @nrwl/schematics@6.1.0
+-- npm-check@5.7.1
+-- protractor@5.3.2
+-- tslint@5.10.0
`-- typescript@2.9.2
FrozenPandaz commented 5 years ago

Hi all,

This is a relatively old issue. I also believe most of the issues mentioned in here have since been resolved. If you are still having issues, please open a new issue with more fresh information so we can determine the cause more easily.

The proper way to add Nx to an Angular 6+ repo is ng add @nrwl/schematics.

boeckMt commented 5 years ago

Hi,

i have the same error when adding @nrwl/schematics to a new created angular 7.2 project.

ng add @nrwl/schematics

Schematic input does not validate against the Schema: {"name":null}
Errors:

  Data path ".name" should be string.
hoang-innomize commented 5 years ago

I am also getting the above error when using the latest version of NPX, anyone can help?

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.