ng2-charts
ng2-charts copied to clipboard
Angular Add Does Not Work
ng add ng2-charts
results in an error:
Cannot find module '@angular/cdk/schematics'
Require stack:
- ~/.../demo-v14/node_modules/ng2-charts/schematics/ng-add/steps/add-ng2-charts-module.js
- ~/.../demo-v14/node_modules/ng2-charts/schematics/ng-add/setup-project.js
- ~/.../demo-v14/node_modules/@angular-devkit/schematics/tools/export-ref.js
- ~/.../demo-v14/node_modules/@angular-devkit/schematics/tools/index.js
- ~/.../demo-v14/node_modules/@angular/cli/src/commands/add/cli.js
- ~/.../demo-v14/node_modules/@angular/cli/src/command-builder/command-runner.js
- ~/.../demo-v14/node_modules/@angular/cli/lib/cli/index.js
- ~/.../demo-v14/node_modules/@angular/cli/lib/init.js
Possibly related to #1412, where I see this error in a comment. However it appears that v4.0.0 has that patch, but I still have the issue.
Do we need to install @angular/cdk
? I would expect the ng add
to do that then.
Reproduction of the problem
euphorbus:~/Programming$ npx -p @angular/cli ng new --interactive
npx: installed 211 in 11.16s
? What name would you like to use for the new workspace and initial project? demo-v14
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS [ https://sass-lang.com/documentation/syntax#scss ]
CREATE demo-v14/README.md (1061 bytes)
CREATE demo-v14/.editorconfig (274 bytes)
CREATE demo-v14/.gitignore (548 bytes)
CREATE demo-v14/angular.json (3106 bytes)
CREATE demo-v14/package.json (1039 bytes)
CREATE demo-v14/tsconfig.json (863 bytes)
CREATE demo-v14/.browserslistrc (600 bytes)
CREATE demo-v14/karma.conf.js (1425 bytes)
CREATE demo-v14/tsconfig.app.json (287 bytes)
CREATE demo-v14/tsconfig.spec.json (333 bytes)
CREATE demo-v14/.vscode/extensions.json (130 bytes)
CREATE demo-v14/.vscode/launch.json (474 bytes)
CREATE demo-v14/.vscode/tasks.json (938 bytes)
CREATE demo-v14/src/favicon.ico (948 bytes)
CREATE demo-v14/src/index.html (293 bytes)
CREATE demo-v14/src/main.ts (372 bytes)
CREATE demo-v14/src/polyfills.ts (2338 bytes)
CREATE demo-v14/src/styles.scss (80 bytes)
CREATE demo-v14/src/test.ts (749 bytes)
CREATE demo-v14/src/assets/.gitkeep (0 bytes)
CREATE demo-v14/src/environments/environment.prod.ts (51 bytes)
CREATE demo-v14/src/environments/environment.ts (658 bytes)
CREATE demo-v14/src/app/app-routing.module.ts (245 bytes)
CREATE demo-v14/src/app/app.module.ts (393 bytes)
CREATE demo-v14/src/app/app.component.scss (0 bytes)
CREATE demo-v14/src/app/app.component.html (23115 bytes)
CREATE demo-v14/src/app/app.component.spec.ts (1079 bytes)
CREATE demo-v14/src/app/app.component.ts (213 bytes)
✔ Packages installed successfully.
Successfully initialized git.
euphorbus:~/Programming$ cd demo-v14/
euphorbus:~/.../demo-v14 (main)$ ng version
? Would you like to share anonymous usage data about this project with the Angular Team at
Google under Google’s Privacy Policy at https://policies.google.com/privacy. For more
details and how to change this setting, see https://angular.io/analytics. No
Global setting: enabled
Local setting: disabled
Effective status: disabled
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.1.1
Node: 14.19.2
Package Manager: npm 6.14.17
OS: darwin x64
Angular: 14.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1401.1
@angular-devkit/build-angular 14.1.1
@angular-devkit/core 14.1.1
@angular-devkit/schematics 14.1.1
@schematics/angular 14.1.1
rxjs 7.5.6
typescript 4.7.4
euphorbus:~/.../demo-v14 (main *)$ ng add ng2-charts
ℹ Using package manager: npm
✔ Found compatible package version: [email protected].
✔ Package information loaded.
The package [email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Packages successfully installed.
UPDATE package.json (1092 bytes)
✔ Packages installed successfully.
Cannot find module '@angular/cdk/schematics'
Require stack:
- ~/.../demo-v14/node_modules/ng2-charts/schematics/ng-add/steps/add-ng2-charts-module.js
- ~/.../demo-v14/node_modules/ng2-charts/schematics/ng-add/setup-project.js
- ~/.../demo-v14/node_modules/@angular-devkit/schematics/tools/export-ref.js
- ~/.../demo-v14/node_modules/@angular-devkit/schematics/tools/index.js
- ~/.../demo-v14/node_modules/@angular/cli/src/commands/add/cli.js
- ~/.../demo-v14/node_modules/@angular/cli/src/command-builder/command-runner.js
- ~/.../demo-v14/node_modules/@angular/cli/lib/cli/index.js
- ~/.../demo-v14/node_modules/@angular/cli/lib/init.js
euphorbus:~/.../demo-v14 (main *)$ git s
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: angular.json
modified: package-lock.json
modified: package.json
no changes added to commit (use "git add" and/or "git commit -a")
euphorbus:~/.../demo-v14 (main *)$ npm list ng2-charts
[email protected] ~/.../demo-v14
└── [email protected]