0

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?

Ryan Payne
  • 5,249
  • 4
  • 28
  • 69

1 Answers1

1

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] });
Ryan Payne
  • 5,249
  • 4
  • 28
  • 69