Cannot use npm library - Ajv - jsons chema

I got errors when trying to use ajv library. The errors are as following in the picture.

I don’t see where you’ve instantiated a new instance (const ajv = new Ajv();). At the moment you have a constructor, which is what you’d expect.

At line 10, i printed out a new instance from Ajv class by console.log(new Ajv()) which should work but it gets “TypeError: Ajv is not a constructor”.

After I used powershell as administrator to install the package again, now it worked properly. Thank you.

Hmmm. With the single exception of the first-time-installation of Meteor, you absolutely must not run as administrator in Windows. It sounds like you’ve done that at least once which has messed up your file permissions. Weird problems like this are going to keep coming and biting you.

I strongly recommend that you:

  1. Uninstall all your current Meteor assets (as administrator).
  2. Re-install Meteor (using chocolatey as administrator).
  3. Do everything else as your normal user.
1 Like