Closed jared-christensen closed 6 years ago
I just created a fresh workspace and it worked fine. Did you run it in a clean / empty directory? Maybe try reinstalling @angular/cli and @nrwl/schematics?
I get the same error, and previously I uninstalled @nrwl/schematics and installed it again.
Similar issue, created a new workspace following the docs and it just gave me a blank angular cli project not a workspace and also wouldnt take the ng add
I just got it to work when I added an @ before collection.
ng new myworkspacename --@collection=@nrwl/schematics
I think the docs maybe have a typo.
No @ on this page
https://nrwl.io/nx/guide-nx-workspace
ng new myworkspacename --collection=@nrwl/schematics
With @ on this page
https://nrwl.io/nx/guide-getting-started
ng new myworkspacename --@collection=@nrwl/schematics
What is really confusing is it looks like it should not need the @ according to issue #506
Ah, i used the @
which is why it worked for me.
I also noticed that the docs say to use ng g app
(which doesn't work) when it's supposed to be ng g application
... so, heads up for that
Edit: Just noticed... using the @
didn't in-fact work... it just used the default angular-cli and no error was thrown. Does angular-cli support mono-repos now by default?
It works with ng new myworkspacename --@collection=@nrwl/schematics
but that's because --@collection
isn't a valid option so it just ignores it and generates a new ng workspace without any of the nx schematics.
I got it to work by globally installing @ngrx/schematics
as well, but then when I tried to generate the workspace it did it in the current directory instead of creating a new directory.
Basically, right now both the docs and the tooling for creating a new nx workspace are broken.
[edit]
but running $ npx create-nx-workspace app-name
seems to work fine
@texel I thought the same too, but I don't think it's using it even when globally installed. (see my updated comment)
Generating a project with angular-cli by itself seems to support applications / libraries now by default
ng new myworkspacename --collection=@nrwl/schematics
also works... the @
in front of collection
was the problem. https://nrwl.io/nx/guide-getting-started should get updated to remove it.
Back to the original issue... I was able to get it to work with the above command and it generated the file structure I was expecting without any errors.
(I'm going to shut up now)
Hey guys,
Sorry for the delayed response. I did some lengthy investigation.
The proper command should indeed be:
ng new workspace --collection=@nrwl/schematics
We will update our documentation.
As you folks have found, there are the following two issues with creating a new Nx Workspace.
Re: @texel
@angular/cli
seems to have a regression. If you are using @angular/cli@6.0.1
you should not have this issue
ng new
cannot find @ngrx/schematics
@angular/cli
cannot resolve our dependency on @ngrx/schematics
. You can help it by installing it yourself.
sudo npm i @ngrx/schematics -g
ng new workspace --collection=@nrwl/schematics
still does not work for me.
Found this, by running "ng add @nrwl/node" resolve this issue for unknown reason lol.
ng new workspace --collection=@nrwl/schematics
still does not work for me.
same, feels like this issue close very soon.....
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.
Im setting up a new project and following the docs found here https://nrwl.io/nx/guide-nx-workspace
When I run
ng new myworkspacename --collection=@nrwl/schematics
I get this error.
I have these globally