ERESOLVE encountered issues resolving the dependency tree for a project using .NET Core 3.1 and Vue.js framework

I encountered an issue while trying to build my application. The error message is as follows:

npm ERR! code ERESOLVE
  npm ERR! ERESOLVE unable to resolve dependency tree
  npm ERR!
  npm ERR! While resolving: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4b7b8bdb1baa0b5a4a494e4fae5fae4">[email protected]</a>
  npm ERR! Found: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="295f5c4c691b071f07181d">[email protected]</a>
  npm ERR! node_modules/vue
  npm ERR!   vue@"^2.6.12" from the root project
  npm ERR!
  npm ERR! Could not resolve dependency:
  npm ERR! peer vue@">=3.0.0" from <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b2c4c7d79fd1dad3c0c6d9dbd1d9f2839c839c82">[email protected]</a>
  npm ERR! node_modules/vue-chartkick
  npm ERR!   vue-chartkick@"^1.0.0" from the root project
  npm ERR!
  npm ERR! Fix the upstream dependency conflict, or retry
  npm ERR! this command with --force, or --legacy-peer-deps
  npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Any suggestions on what might be causing this issue?

The csproj file content that I use for building includes:

<ItemGroup>
    <PackageReference Include="VueCliMiddleware" Version="3.1.2" />
</ItemGroup>
<PropertyGroup>
    <SpaRoot>clientapp\</SpaRoot>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
</PropertyGroup>

<ItemGroup>
    <!-- Don't publish the SPA source files, but do show them in the project files list -->
    <Content Remove="$(SpaRoot)**" />
    <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
</ItemGroup>

<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build">
    <!-- Build Target:  Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
        <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Exec Command="npm --version" ContinueOnError="true">
        <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js and npm are required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
</Target>

<Target Name="EnsureNodeModulesInstalled" BeforeTargets="Build" Inputs="package.json" Outputs="packages-lock.json" Condition="!Exists('$(SpaRoot)node_modules')">
    <!-- Build Target: Restore NPM packages using npm -->
    <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
</Target>

<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
    <!-- Build Target: Run webpack dist build -->
    <Message Importance="high" Text="Running npm build..." />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --modern" />

    <!-- Include the newly-built files in the publish output -->
    <ItemGroup>
        <DistFiles Include="$(SpaRoot)dist\**" />
        <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
            <RelativePath>%(DistFiles.Identity)</RelativePath>
            <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
            <ExcludeFromSingleFile>True</ExcludeFromSingleFile>
        </ResolvedFileToPublish>
    </ItemGroup>
</Target>

Answer №1

It appears that an error is occurring because you have Vue 2 installed, but the vue-chartckick package requires Vue 3.

The package's readme explicitly states:

The most recent version is compatible with Vue 3. For Vue 2 compatibility, use version 0.6.1 and refer to this readme https://github.com/ankane/vue-chartkick/blob/v0.6.1/README.md.

To resolve this issue, you can either switch to the recommended package version or upgrade your Vue installation to version 3.

Answer №2

The successful solution involved removing the node_modules directory locally as well as deleting the %appdata%\Roaming\npm-cache folder.

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

Refining an array data table within a nested component

Transitioning my old PHP/jquery single-page applications to VueJS/Webpack has been a journey I'm undertaking to familiarize myself with the latter technology. It involves converting a simple table that pulls data from a JSON API and incorporates filte ...

Transitioning from angular version 5.2 to the latest angular 6.1 version

Currently, I find myself on node 8.11 and utilizing VS code. The project was originally built in version 5.2.5 but has been inactive for some time now. Within my project, the following modules are present: import { BrowserModule } from '@angular/plat ...

Can anyone provide guidance on how to access an element's id in Vue.js?

Is there a way to retrieve the id of an element using vue js? The elements are generated dynamically through v-for from the youtube data API. <v-card v-for="video in videos" :key="video.snippet.resourceId.videoId"> <v-img :src="video.snippe ...

module for digital signature using soap in Node.js

I am inquiring about the npm module "soap" and whether it supports digital signatures. I would like to create a soap header as shown below: <s:Header> <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws ...

What is the best way to distribute components between two NextJS projects?

Confused about the best way to share ReactJs components between two NextJs applications - one for e-commerce and the other for a manager portal. In the e-commerce app, there are various UI components that I want to reuse in the manager portal. Considering ...

Controllers in Laravel are not detecting the public function

Recently, I obtained a Laravel/Vue.js project from Bitbucket for the company I am currently collaborating with. Setting it up on my computer seemed like a routine task since I have worked on similar projects in the past. However, this time around, I encoun ...

The specified version of Mongodb in the package.json file is encountering difficulties during the installation

If the command npm install mongodb is executed, the desired version of mongodb gets installed successfully: - email protected node_modules/mongodb/node_modules/bson email protected] /home/lorencm/Downloads/mongo-invoices └─┬ email protected] ├ ...

Adding a character at the current cursor position in VUE JS

My quest for inserting emojis in a textarea at the exact cursor position has led me to an extensive search on Vue JS techniques. However, most resources available online provide solutions using plain Javascript. Here is the code snippet I am working with: ...

What are the most effective techniques for combining Vue.JS and Node.js backends into a single Heroku container?

I came across an interesting blog post today that discusses a method for deploying React applications. The author begins with a Node project and then creates a React project within a subfolder, along with some proxy configuration. About 10 days ago, I did ...

Utilizing Vuex in Vue with vue-enterprise-boilerplate: A Step-by-Step Guide

I am attempting to incorporate Vuex into my project using the chrisvfritz/vue-enterprise-boilerplate template. However, I am facing uncertainty regarding how to proceed. Within the <script> section of the "courses.vue" view component, the code appea ...

How come eslint is unable to detect all files within a directory, yet it can detect a single file?

Here is the organization of my files and directories. https://i.stack.imgur.com/YWNw3.png I am looking to set up some eslint rules for my code detection. In my .eslintrc file, I have included these configuration settings. { "extends": "airbnb", "ru ...

Verify whether a variable includes the tag name "img."

Currently, I am working with a variable that holds user input in HTML format. This input may consist of either plain text or an image. I am looking to determine whether the user has entered an image or just simple text. Here is an example of user entry: t ...

Perpetually launching "npm start" on the server

I have been attempting to deploy an angular2 test application on a server. It is functioning well on my local machine using the command NPM start as indicated in my package.json file: "start": "concurrent \"npm run tsc:w\" \"npm run lite&bs ...

Unable to initialize the bootstrap datepicker module

I'm having trouble initializing bootstrap-datepicker from this GitHub repository: https://github.com/uxsolutions/bootstrap-datepicker. I can't seem to get it to work properly or call any methods or events on it. My setup includes Laravel 5.4.7, ...

Prevent Typing in Vuetify's Combobox - A Guide to Disabling Input in the Vuetify Combobox

Is there a way to prevent users from typing inside the vuetify combobox? Below is my current implementation of the combobox: <v-combobox :loading="isSurveyBeingPopulated" class="static--inputs" color="red" box :items="folders" :rules="[rules.required] ...

What is the reason behind the command "npm-install" placing files directly into the root directory?

After pulling my front-end project from the repository, I noticed that the node_modules folder was missing. My usual approach is to use npm install to get all the dependencies listed in the package.json file installed. However, this time around, I ended u ...

Resetting Zoom in Vue Chart.js

I'm currently working on implementing zoom functionality on a chart using vue-chartjs and the chartjs-plugin-zoom. The code I have written is giving me an error saying "this.$refs.myChart.resetZoom is not a function". How can I properly reference the ...

Having trouble utilizing the ng-Command in Angular?

Currently, I am attempting to set up Angular in a vagrant-box environment. npm install -g @angular/cli Unfortunately, I encounter an error while trying to use the client: The program 'ng' is currently not installed. You can install it by typin ...

Using a temporary variable within a Vue loop

Currently, I am utilizing Vue along with Vuetify to create a menu containing links using the treeview component. The data source I'm working with is a nested JSON structure. The issue I am facing is regarding linking the parent "to" with its children ...