[英]Why am I getting a "Cannot find module 'jsonLogic'" error?
I've installed JsonLogic using Yarn .我已经使用Yarn安装了JsonLogic 。
yarn add json-logic-js
When I attempt to implement a simple example:当我尝试实现一个简单的例子时:
import jsonLogic from 'jsonLogic';
jsonLogic.apply({ '==': [1, 1] });
I get the following error:我收到以下错误:
Cannot find module 'jsonLogic'
Why can't Node find the JsonLogic module?为什么 Node 找不到 JsonLogic 模块? And how do I resolve this issue?我该如何解决这个问题?
You're referencing a nonexistent module.您正在引用一个不存在的模块。 Import the json-logic-js
module, not the nonexistent jsonLogic
module.导入json-logic-js
模块,而不是不存在的jsonLogic
模块。 For example:例如:
import jsonLogic from 'json-logic-js';
jsonLogic.apply({ '==': [1, 1] });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.