When using npm to install Angular Bootstrap, the versions that are installed do not always match the specific versions

Displayed below is the content of my package.json file.

{
"name": "MyProject",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"@angular/animations": "5.0.2",
"@angular/common": "5.0.2",
...

This configuration was mostly auto-generated by ASP.Net Core 2 template using the "dotnet new angular" command. Modifications were made to include ng-bootstrap and update versions to Angular 5.0.2 and Bootstrap 4.0.0 as recommended.

Despite this, running "npm install" results in lower versions being installed.

├── @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a2c3cccbcfc3d6cbcdcd...">[email protected]</a>
...

Consequently, an error occurs when launching my application.

NodeInvocationException: Can't resolve all parameters for
NgbModalStack: ([object Object], [object Object], [object Object], ?).
Error: Can't resolve all parameters for NgbModalStack: ([object Object], [object Object], [object Object], ?).
...

The root cause of the problem seems to be related to version discrepancies, highlighted in this issue.

Answer №1

First, start by incorporating the npm package ng-bootstrap using your desired version.

Next, remove the package-lock.json and node modules folder from your project.

Then, review the package.json file to see if there are any other unnecessary bootstrap entries. If you find any, delete them and ensure that only the desired ng-bootstrap version remains in the file.

Lastly, reinstall the npm modules by running the command npm i.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular2, multi-functional overlay element that can be integrated with all components throughout the application

These are the two components I have: overlay @Component({ selector: 'overlay', template: '<div class="check"><ng-content></ng-content></div>' }) export class Overlay { save(params) { //bunch ...

Is there a way to reset the yAxes count of a chart.js chart in Angular when changing tabs?

I am currently using chart.js within an Angular framework to visually display data. Is there any method available to reset the y-axis data when changing tabs? Take a look at this Stackblitz demo for reference. Upon initial loading of the page, the data ...

Transform HTML elements within an *ngFor iteration based on a specific variable in Angular 4

In my current project using Angular 4, I am faced with the task of dynamically modifying HTML tags within an *ngFor loop based on a variable. Here is the code snippet that represents my approach: <mat-card-content *ngFor="let question of questionGrou ...

"Error message pops up indicating the dispatcher is missing while using npm link with a local project

Currently, I am working on a React component library that I want to integrate into a local project for testing purposes. My initial approach was to use npm link to connect the component library with my local project. However, during this process, I encount ...

What is the process for implementing filtered HTML attributes in a directive?

I’ve created a custom directive that generates a popup menu by extracting data from HTML content. The purpose is to transform a group of Bootstrap carousel-compatible elements into a structured list. However, each .item element contains an attribute with ...

It seems like there is a glitch in the npm registry causing an undefined error. Let's try again

Attempting to add necessary dependencies to my project, however, encountering an error when executing yarn install [2/5] ...

Creating a Form in a Popup with Bootstrap

I have implemented Bootstrap on my website. Check it out at: hubb.tekkkz.com I am facing an issue where, when clicking on the login/register button on the right, the modal pops up. However, the user input elements within the modal are not taking up the ful ...

Step-by-step guide on incorporating an external JavaScript library into an Ionic 3 TypeScript project

As part of a project, I am tasked with creating a custom thermostat app. While I initially wanted to use Ionic for this task, I encountered some difficulty in integrating the provided API into my project. The API.js file contains all the necessary function ...

Modify animation trigger when mouse hovers over

I am looking to create a feature where a slide overlay appears from the bottom of a thumbnail when the user hovers over it, and retracts when the user is not hovering. animations: [ trigger('overlaySlide', [ state(&ap ...

Why do I keep encountering the error "global is not defined" when using Angular with amazon-cognito-identity-js?

To start, run these commands in the command line: ng new sandbox cd .\sandbox\ ng serve Now, navigate to http://localhost:4200/. The application should be up and running. npm install --save amazon-cognito-identity-js In the file \src&bso ...

The npm package manager in Node.js seems to be installing the incorrect package

Apologies for not being able to provide links due to restrictions from stackoverflow. I encountered a strange error while attempting to install the Ghost Blogging Platform in my nodejs project using npm. The command I used was: npm install ghost However ...

Why am I encountering difficulties running my Next.js project?

I have cloned projects that are 5 months old from GitHub and I am currently using Node.js version 18 or higher. Here is what I have tried: npx install cross-env //Tried installing and adding the following code to package.json "dev": "cross-env NODE_OPTI ...

Steps to resolve the 'aws-cdk command not found' error post npm install

I'm currently in the process of setting up the aws-cdk on my system. I entered the command npm install -g aws-cdk into the terminal as instructed here. After npm completes the installation, the following output is displayed: /usr/local/Cellar/node/9. ...

Issue with retrieving relative time using Moment.js - fromNow()

I want to utilize moment.js to display relative time fromNow(), but I am encountering an issue where the values are being rounded and showing higher durations instead of exact completion times. For example, moment().subtract('s',110).fromNow() / ...

An error occurred when attempting to run the command npm run compile:sass, displaying the message: npm ERR! missing script:

Everything seems to be in place with the sass folders and files, so what could be the issue? I have my package.json file set up correctly with the following code: { "name": "starter", "version": "1.0.0", " ...

How to integrate a chips feature in Angular 4 using Typescript

Struggling to incorporate a chips component into my Angular web application, which comprises Typescript, HTML, and CSS files. After grappling with this for weeks without success, I have yet to find the right solution. To review my current code, you can a ...

Tips for displaying dynamic images using the combination of the base URL and file name in an *ngFor loop

I have a base URL which is http://www.example.com, and the file names are coming from an API stored in the dataSource array as shown below: [ { "bid": "2", "bnam": "ChickenChilli", "adds": "nsnnsnw, nnsnsnsn", "pdap": " ...

Present information in a tabular format upon identifying an individual's ID using Angular

I encountered a specific issue recently. I successfully connected an API to my database using Angular, and it functions well by displaying all the data in a table. However, when I try to retrieve data for a single ID, the result can only be seen in an inpu ...

Is there a way to execute publish without automatically triggering postpublish?

I am working on a project that includes a specific postpublish action in its package.json. Recently, I encountered a situation where I need to run the publish command without triggering the associated postpublish action. Is there a foolproof method to exe ...

Ways to push node modules to GitHub using a forceful method

Although it is commonly recommended not to include node modules in a git repository (as discussed here and in various other sources), I have my reasons for wanting to do so: I prefer to check module updates for safety before delivering them to clients I w ...