telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
467 stars 216 forks source link

ng add doesn't add all required dependencies #1571

Closed av8orbynight closed 6 years ago

av8orbynight commented 6 years ago

I'm submitting a...

Current behavior

running ng add @progress/kendo-angular-grid on Angular 6 doesn't install all dependencies, according to NPM messages. Also receive obscure "Cannot read property 'options' of undefined" message.

Expected behavior

No missing peer dependency warnings.

Minimal reproduction of the problem with instructions

run ng add @progress/kendo-angular-grid

What is the motivation or use case for changing the behavior?

Environment

Package versions:

├── @angular-devkit/build-angular@0.6.5
├── @angular/animations@6.0.3
├── @angular/cdk@6.1.0
├── @angular/cli@6.0.5
├── @angular/common@6.0.3
├── @angular/compiler@6.0.3
├── @angular/compiler-cli@6.0.3
├── @angular/core@6.0.3
├── @angular/flex-layout@6.0.0-beta.15
├── @angular/forms@6.0.3
├── @angular/http@6.0.3
├── @angular/material@6.1.0
├── @angular/platform-browser@6.0.3
├── @angular/platform-browser-dynamic@6.0.3
├── @angular/router@6.0.3
├── @ng-bootstrap/ng-bootstrap@2.0.0
├── @ngx-translate/core@10.0.2
├── @ngx-translate/http-loader@3.0.1
├── UNMET PEER DEPENDENCY @progress/kendo-angular-buttons@^4.0.0
├── UNMET PEER DEPENDENCY @progress/kendo-angular-dateinputs@2 - 3
├── UNMET PEER DEPENDENCY @progress/kendo-angular-dropdowns@2 - 3
├── UNMET PEER DEPENDENCY @progress/kendo-angular-excel-export@1 - 2
├── @progress/kendo-angular-grid@3.4.0
├── UNMET PEER DEPENDENCY @progress/kendo-angular-inputs@2 - 3
├── UNMET PEER DEPENDENCY @progress/kendo-angular-intl@^1.0.0
├── UNMET PEER DEPENDENCY @progress/kendo-angular-l10n@^1.1.0
├── UNMET PEER DEPENDENCY @progress/kendo-angular-popup@^2.0.0
├── UNMET PEER DEPENDENCY @progress/kendo-data-query@^1.0.0
├── UNMET PEER DEPENDENCY @progress/kendo-drawing@^1.0.0
├── @types/d3@5.0.0
├── @types/gapi@0.0.35
├── @types/gapi.auth2@0.0.47
├── @types/googlemaps@3.30.8
├── @types/jasmine@2.8.7
├── @types/leaflet@1.2.7
├── @types/node@10.1.3
├── @types/webpack-env@1.13.6
├── ag-grid@17.1.1
├── ag-grid-angular@17.1.0
├── bootstrap@4.1.1
├── compression-webpack-plugin@1.1.11
├── core-js@2.5.7
├── d3@5.4.0
├── font-awesome@4.7.0
├── friendly-errors-webpack-plugin@1.7.0
├── gojs@1.8.20
├── html-webpack-plugin@3.2.0
├── jasmine-core@3.1.0
├── jasmine-spec-reporter@4.2.1
├── jquery@3.3.1
├── jwt-decode@2.2.0
├── leaflet@1.3.1
├── popper.js@1.14.3
├── protractor@5.3.2
├── rxjs@6.2.0
├── sass-loader@7.0.1
├── screenfull@3.3.2
├── tslint@5.10.0
├── typescript@2.7.2
├── uglify-js@3.3.28
├── webdriver-manager@12.0.6
├── webpack-build-notifier@0.1.25
├── webpack-dev-middleware@3.1.3
├── webpack-hot-middleware@2.22.2
├── webpack-merge@4.1.2
└── zone.js@0.8.26

Browser:

System:

output of command:

MacBook-Pro:envoy-client username$ ng add @progress/kendo-angular-grid
Installing packages for tooling via npm.
Cannot read property 'options' of undefined

I have also:

blown out node-modules removed package-lock.json ran npm cache clean --force ran npm install

retried npm add...

Also, the schematics didn't install any theming or styles.

av8orbynight commented 6 years ago

Attempting any install has the same behavior:

Kriss-MBP:envoy-client username$ ng add @progress/kendo-angular-buttons
Installing packages for tooling via npm.
(dynamic progress bar installs some dependencies)

result:

npm WARN @progress/kendo-angular-buttons@4.1.1 requires a peer of @progress/kendo-angular-l10n@^1.1.0 but none is installed. You must install peer dependencies yourself.

+ @progress/kendo-angular-buttons@4.1.1
added 4 packages from 1 contributor and audited 21945 packages in 10.896s
found 0 vulnerabilities

Installed packages for tooling via npm.
Cannot read property 'options' of undefined

no styles or themes installed

this is being run from my project root

av8orbynight commented 6 years ago

I was able to resolve the issue by specifying my project name:

ng add @progress/kendo-angular-buttons --project TheProjectName

This might be an opportunity to notate on the Angular 6 CLI docs the potential need for such specification. I don't have more than one project specified in my angular.json file, so I'm not sure how my particular use case varies, but this is for an existing--versus quick start--project.

EDIT: (Actually, I do have 2 projects, the other is an e2e project, which is not the default project, which is probably a common use case).

Thanks.

rusev commented 6 years ago

Hey @av8orbynight , thank you for contacting us.

It seems that you are executing ng add within the e2e project folder. Currently ng add of Kendo UI package will ignore the e2e project. The reasoning behind this is that you won't need our components in the e2e project. It is similar to what @angular/material does.

That said specifying the project name is a valid approach in this case.

destus90 commented 6 years ago

I get these warnings too. (WIndows 10 x64)

rusev commented 6 years ago

Hey @destus90

When you run ng add @progress/kendo-angular-buttons the angular/cli first installs the @progress/kendo-angular-buttons package. As the package has peer dependencies listed in the package.json npm will print a warning that there are unmet peer dependencies.

After the package has been installed the angular cli will run our schematics script which will install these dependencies.

That said the message you see is expected. If you inspect the installed node_modules you should see that all peer dependencies are installed.