When i use the command: ng add @nrwl/schematics to add @nrwl into my existing Angular Project. I get the bellow erorr:
"Installing packages for tooling via npm.
npm WARN @nguniversal/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @nguniversal/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @nguniversal/[email protected] requires a peer of @angular/platform-server@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm audit fix to fix them, or npm audit for details========
Here is some information my Angular Project
"devDependencies": {
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.9",
"@angular/language-service": "6.0.9",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "2.7.2",
"@angular-devkit/build-angular": "~0.6.8"
}
Please help me to solve this issue?
Could you provide a repro? (something we can run ng add on)
@vsavkin I'm running into the same issue. Steps to reproduce:
ng new regularApp
cd regularApp
ng add @nrwl/schematics
Output:
Installing packages for tooling via npm.
+ @nrwl/[email protected]
added 44 packages in 8.916s
Installed packages for tooling via npm.
Cannot read property 'sourceRoot' of undefined
Environment:
Angular CLI: 6.1.5
Node: 8.11.4
Angular: 6.1.4

This is also the case for me, indicating that root is not defined
Same issue here

Environment:
Angular CLI: 7.0.2
Node: 10.10.0
OS: darwin x64
Angular: 7.0.0
Hi,
We recommend to create a new Nx workspace with the following command:
create-nx-workspace myWorkspaceName
You can see more information on the official documentation here.
Please, could you point the source where you saw how to do it like that?
We have updated our doc few releases back but it seems to be a big source of confusion.
Closing the ticket since it is old.
@bcabanes I'm running into the same issue (as the others I need to add Nx to an existing application)
According to the documentation ...
"You can also add Nx capabilities to an existing CLI project by running:
ng add @nrwl/schematics
"
Angular CLI 7.0.4
Angular 7.0.2
nrwl/nx 7.0.0
Hello @bcabanes , why this issue was closed?
I'm facing the same issue, and is not when I create new workspace, but when trying to add nx capabilities to an existing CLI project, as @catellanir says, it's in the official documentation.
Same Problem: Cannot read property 'sourceRoot' of undefined
Angular CLI: 7.0.6
Node: 10.13.0
OS: darwin x64
Angular: 7.0.4
This issue related to camel case project name in angular.json and snake case project name in package.json
@vsavkin I'm running into the same issue. Steps to reproduce:
ng new regularApp cd regularApp ng add @nrwl/schematicsOutput:
Installing packages for tooling via npm. + @nrwl/[email protected] added 44 packages in 8.916s Installed packages for tooling via npm. Cannot read property 'sourceRoot' of undefinedEnvironment:
Angular CLI: 6.1.5
Node: 8.11.4
Angular: 6.1.4
Use small case for app creation will rectify this issue.
For Eg: ng new regular-app and then cd regular-app and ng add @nrwl/schematics
@spidermon thanks I amended my angular.json project name to match and it worked like a charm :)
Most helpful comment
This is also the case for me, indicating that root is not defined