Hi all,
Great initiative and I am sure it will be a huge timesaver for our project.
However, installing it does not come easy on windows :)
The setup:
Note: We are trying to use default npm instead of yarn
Steps to reproduce:
npm i -g @angular/[email protected]npm i -g @nrwl/schematicsng new sometestproject --collection=@nrwl/schematics@schematics/angular and @angular-devkit/schematics )npm i -g @schematics/angularnpm i -g @angular-devkit/schematicsng new sometestproject --collection=@nrwl/schematicsMy suspicion is that not using yarn might be the culprit, but then my question is: should it not just work out of the box with "vanilla" npm?
I have tried downgrading @angular/cli and @nrwl/schematics to earlier versions, that also did not do the trick.
Just putting this here for other people that might also experience the same issue. Would also be nice if we can solve it (willing to contribute).
Update:
@see https://github.com/angular/angular-cli/issues/8053
Seems to be related to a bug in @angular/cli
@DennisJaamann did you try using yarn to install the packages? I was running into a different issue during the initial install, but the problem was resolved once I went the yarn route recommended by the documentation
@Pamo,
I managed to install it perfectly with the script on my Mac as indicated in the getting started guide.
With yarn, this also works as expected. I can understand however that this was not clear from my initial question.
But the problem is more that I see no difference in installing with vanilla npm i -g vs. installing with yarn add global from a _conceptual_ point of view. Yarn vs. npm5+ should be interchangeable (or that is what I expected anyway, since 95% of all other npm libraries out there will work that way).
The getting started also specifically mentions that the usage of yarn is not a hard requirement, hence this makes it perfectly plausible that others might interpret this the same way and install via npm i -g as well. This makes it likely they will encounter the same issues I encountered. My intention was merely to document this to save others the same trouble.
In addition if someone were to find a workaround / fix that would be great as well.
According to the getting started:
Yarn does a better job at recognizing and dealing with multiple peer dependencies on globally installed packages, thus is recommended (but not a hard requirement)
See my original issue:
My suspicion is that not using yarn might be the culprit, but then my question is: should it not just work out of the box with "vanilla" npm?
Just putting this here for other people that might also experience the same issue. Would also be nice if we can solve it (willing to contribute).
Thank you for your feedback, it made me realise I needed to give more context to this issue.
Awesome, we're on the same page. I had the same suspicions and really appreciate your indepth description of what is going on!
Related to this issue:
We will update the docs site to be more clear about the issues with yarn vs npm.
Most of the schematics in Nx can be used in existing Angular CLI projects so it's possible to install @nrwl/schematics and @nrwl/nx into a CLI project and set the default schematic collection to @nrwl/schematics and be off and running without the need for yarn. Thus the mention of it not being a hard requirement. It's just an issue when you are wanting to create a new project that the npm linking is a problem.
Most helpful comment
@Pamo,
I managed to install it perfectly with the script on my Mac as indicated in the getting started guide.
With yarn, this also works as expected. I can understand however that this was not clear from my initial question.
But the problem is more that I see no difference in installing with vanilla
npm i -gvs. installing withyarn add globalfrom a _conceptual_ point of view. Yarn vs. npm5+ should be interchangeable (or that is what I expected anyway, since 95% of all other npm libraries out there will work that way).The getting started also specifically mentions that the usage of yarn is not a hard requirement, hence this makes it perfectly plausible that others might interpret this the same way and install via
npm i -gas well. This makes it likely they will encounter the same issues I encountered. My intention was merely to document this to save others the same trouble.In addition if someone were to find a workaround / fix that would be great as well.
According to the getting started:
See my original issue:
Thank you for your feedback, it made me realise I needed to give more context to this issue.