Topic: 'ng add' fails due to missing prerequisite
drullo free asked 6 years ago
The documentation states that angular-bootstrap-md can be installed using an Angular CLI schematic with the ng add angular-bootstrap-md
command. However, that command fails because the npm-registry-client is required. I believe the documentation should be updated to reflect that required. Or, the schematic should be changed so that it doesn't require that package.
Damian Gemza staff answered 6 years ago
Dear @drullo
Could you please describe me, in which scenario you're getting an error, that npm-registry-client is required?
I have tried to reproduce your problem on the fresh angular project. I have created it and executed ng add angular-bootstrap-md, and for me, our package was installed successfully.
Here's the output log from the terminal:
damian@damian-Latitude-E7440:~/Desktop/work/721-dev$ ng new tst --style=scss --routing=false
CREATE tst/README.md (1020 bytes)
CREATE tst/angular.json (3832 bytes)
CREATE tst/package.json (1310 bytes)
CREATE tst/tsconfig.json (408 bytes)
CREATE tst/tslint.json (2837 bytes)
CREATE tst/.editorconfig (245 bytes)
CREATE tst/.gitignore (503 bytes)
CREATE tst/src/favicon.ico (5430 bytes)
CREATE tst/src/index.html (290 bytes)
CREATE tst/src/main.ts (372 bytes)
CREATE tst/src/polyfills.ts (3234 bytes)
CREATE tst/src/test.ts (642 bytes)
CREATE tst/src/styles.scss (80 bytes)
CREATE tst/src/browserslist (388 bytes)
CREATE tst/src/karma.conf.js (964 bytes)
CREATE tst/src/tsconfig.app.json (166 bytes)
CREATE tst/src/tsconfig.spec.json (256 bytes)
CREATE tst/src/tslint.json (314 bytes)
CREATE tst/src/assets/.gitkeep (0 bytes)
CREATE tst/src/environments/environment.prod.ts (51 bytes)
CREATE tst/src/environments/environment.ts (662 bytes)
CREATE tst/src/app/app.module.ts (314 bytes)
CREATE tst/src/app/app.component.scss (0 bytes)
CREATE tst/src/app/app.component.html (1141 bytes)
CREATE tst/src/app/app.component.spec.ts (969 bytes)
CREATE tst/src/app/app.component.ts (208 bytes)
CREATE tst/e2e/protractor.conf.js (752 bytes)
CREATE tst/e2e/tsconfig.e2e.json (213 bytes)
CREATE tst/e2e/src/app.e2e-spec.ts (299 bytes)
CREATE tst/e2e/src/app.po.ts (208 bytes)
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
> node-sass@4.9.3 install /home/damian/Desktop/work/721-dev/tst/node_modules/node-sass
> node scripts/install.js
Cached binary found at /home/damian/.npm/node-sass/4.9.3/linux-x64-57_binding.node
> node-sass@4.9.3 postinstall /home/damian/Desktop/work/721-dev/tst/node_modules/node-sass
> node scripts/build.js
Binary found at /home/damian/Desktop/work/721-dev/tst/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.6 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1103 packages from 1166 contributors and audited 39138 packages in 32.618s
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
Successfully initialized git.
damian@damian-Latitude-E7440:~/Desktop/work/721-dev$ cd tst
damian@damian-Latitude-E7440:~/Desktop/work/721-dev/tst$ ng add angular-bootstrap-md
Installing packages for tooling via npm.
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/core@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/common@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/http@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.6 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ angular-bootstrap-md@7.2.0
added 1 package and audited 39139 packages in 8.488s
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
Installed packages for tooling via npm.
Added "chart.js" into dependencies
Added "@types/chart.js" into dependencies
Added "font-awesome" into dependencies
Added "hammerjs" into dependencies
Installing packages...
"MDBBootstrapModule" is imported.
.forRoot() method should be added for MDBBootrapModule. If not, please add it!
Added "font-awesome into angular.json file"
Added "bootstrap into angular.json file"
Added "mdb into angular.json file"
Added "chart.js into angular.json file"
Added "hammerjs into angular.json file"
UPDATE package.json (1464 bytes)
UPDATE src/app/app.module.ts (407 bytes)
UPDATE angular.json (4167 bytes)
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/core@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/common@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-bootstrap-md@7.2.0 requires a peer of @angular/http@^7.2.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.6 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 8 packages from 29 contributors and audited 39148 packages in 8.226s
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
damian@damian-Latitude-E7440:~/Desktop/work/721-dev/tst$
So as you can see, there were no problems.
Could you please check, if your problem exists on the fresh angular project?
Best Regards,
Damian
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.0.0
- Device: PC
- Browser: Chrome
- OS: Windows 10
- Provided sample code: Yes
- Provided link: No