I've installed JsonLogic using Yarn.
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? And how do I resolve this issue?
You're referencing a nonexistent module. Import the json-logic-js
module, not the nonexistent jsonLogic
module. For example:
import jsonLogic from 'json-logic-js';
jsonLogic.apply({ '==': [1, 1] });