0

I have ngx-bootstrap 5.6.2 and I want/need to install 6 or above, but when I try

npm install ngx-bootstrap --save

and

npm install ngx-bootstrap 6.2.0

It doesn't install it, it just uninstalls 5.6.2 and then reinstalls it.

Am I doing something wrong? Or is the latest version not in npm? It says it is... npm link

Running

  1. Angular 10
  2. Bootstrap 4+
chuckd
  • 13,460
  • 29
  • 152
  • 331
  • try to delete your package-lock.json before running the install command – Ben Bradshaw Nov 16 '20 at 00:33
  • do I do that with a npm delete or is there a different method to delete the package-lock stuff? – chuckd Nov 16 '20 at 00:35
  • you can simply delete the file, or run $ rm package-lock.json from the terminal (make sure your current working directory in the terminal is the same directory as the package-lock.json) – Ben Bradshaw Nov 16 '20 at 00:37
  • I'm a little hesitant to rm files like that as I'm not an expert with angular project files. Wouldn't it be easier to just uninstall the npm and then install from scratch? – chuckd Nov 16 '20 at 00:38
  • 2
    uninstalling and reinstalling npm won't help with this. Use your file browser, IDE, or any way that you can delete the package-lock.json file. right-click -> delete. Then when you npm install, it will recreate the package-lock.json file for you with the correct build number of ngx-boostrap and all other packages that you have installed. you will have the version you want. also, you can try looking at this post. https://stackoverflow.com/questions/22343224/whats-the-difference-between-tilde-and-caret-in-package-json – Ben Bradshaw Nov 16 '20 at 00:43
  • ok,it worked! thanks – chuckd Nov 16 '20 at 00:48

0 Answers0