安装React-chartjs-2 Chart.js时,引擎“节点”与此模块不兼容,

问题描述

我通过使用带有其响应包装器的chart.js创建一个甜甜圈图。在新项目中可以正常工作,但不能在主项目中安装它。

下面是一个新项目的示例,该项目运行正常。

enter image description here

下面是主要旧项目的示例,我无法在其中安装

enter image description here

错误

引擎“节点”与此模块不兼容

节点版本相同,您可以检入两个图像。

解决方法

您需要升级节点版本。。在使用husky v4时,您需要 node> = 10

选中husky installation guideThe engine “node” is incompatible with this module

,

从日志中,我可以看到这与您当前拥有的节点版本有关。在您的日志中看到这一行

The engine "node" is incompatible with the module. Expected version ">=10". Got "8.10.0"

要解决此问题,您可以尝试

 1. Install nvm
 2. Download another version of node ">=10"
 3. Switch to that the latest version
 4. And try installing the module again

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...