Topic: ng-mdb-pro module gets removed when installing new modules

nedzeplin pro asked 6 years ago


I have just started a new Angular project using MDB, installing it via npm.  I have noticed that whenever I install other modules via npm, my ng-mdb-pro module gets deleted.  I have to run npm install again on my project, and then the ng-mdb-pro module gets re-downloaded and installed.  I know this sounds kind of crazy -- I have never seen anything like this before, but was wondering if I was doing something obviously wrong.

nedzeplin pro answered 6 years ago


Hi Damian, I checked my package-lock.json file, and it contains the following:
"ng-mdb-pro": {
"version": "git+https://oauth2:###########@git.mdbootstrap.com/mdb/angular/ng-pro.git#[big long alphanumeric here]"
},
Is this correct?
Thanks,
Ed

Damian Gemza staff commented 6 years ago

Dear Ned, please update your npm to the latest version (for now it's 5.8.0). This problem is caused by npm in version 5.6.0. After upgrade to 5.8.0 problem has gone away. Tested on my Ubuntu 17.04. Best Regards, Damian

nedzeplin pro answered 6 years ago


Hi Damian, I have npm version 5.6.0 running on Windows 10, Angular version 5.2.0. I read through the link that you sent me, but honestly did not understand very much of it.  Let me know if there is something you want me to try.  Of the many modules I have installed, ng-mdb-pro is the only one that gets removed when I install a new module. I just tried updating npm using "npm i npm" and got the following error related to ng-mdb-pro (NOTE:  I am running as Administrator): npm i npm npm ERR! path C:gitmyappnode_modulesng-mdb-profreebuttons npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:gitmyappnode_modulesng-mdb-profreebuttons' npm ERR! { Error: EPERM: operation not permitted, unlink 'C:gitmyappnode_modulesng-mdb-profreebuttons' npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'C:gitmyappnode_modulesng-mdb-profreebuttons' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\git\myapp\node_modules\ng-mdb-pro\free\buttons' }, npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'C:\git\myapp\node_modules\ng-mdb-pro\free\buttons'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\git\myapp\node_modules\ng-mdb-pro\free\buttons', npm ERR! parent: 'myapp' } npm ERR! npm ERR! Please try running this command again as root/Administrator.    

nedzeplin pro commented 6 years ago

Damian, I was incorrect with my Angular version. Here is what I get when I type "ng version": Angular CLI: 1.7.3 Node: 8.9.4 OS: win32 x64 Angular: 5.2.9 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router @angular/cli: 1.7.3 @angular-devkit/build-optimizer: 0.3.2 @angular-devkit/core: 0.3.2 @angular-devkit/schematics: 0.3.2 @ngtools/json-schema: 1.2.0 @ngtools/webpack: 1.10.2 @schematics/angular: 0.3.2 @schematics/package-update: 0.3.2 typescript: 2.5.3 webpack: 3.11.0 When I re-install ng-mdb-pro, I get the following warnings, and I think this is because I have more recent versions of Angular than what your package expects. Do I need to downgrade my Angular from 5.2.9 to 5.2.6? npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/animations@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/common@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/compiler@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/core@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/forms@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/http@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/platform-browser@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/platform-browser-dynamic@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself. npm WARN ng-mdb-pro@5.2.3 requires a peer of @angular/router@5.0.0 - 5.2.6 but none is installed. You must install peer dependencies yourself.

Damian Gemza staff commented 6 years ago

Dear nedzeplin, You're right. This warnings informs you, that you're using newer version of angular that we're officially supporting. You can ignore them, because for 99.99% chances everything is working fine with your version of NG. About your first problem: Please check, if you're having an package-lock.json file, and if this file contains ng-mdb-pro library. If not, you have to add it to this file. Here you can read more about package-lock.json file: https://medium.com/@Quigley_Ja/everything-you-wanted-to-know-about-package-lock-json-b81911aa8ab8 Best Regards, Damian

Damian Gemza staff answered 6 years ago


Dear nedzeplin,

Could you provide me your environment informations? (Os, Node version, angular version etc). I'll take a look at this.
Please also check this solutions. Maybe that's the case: https://github.com/npm/npm/issues/16853

Best Regards,
Damian



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags