Cannot use npm library - Ajv - jsons chema


#1

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


#2

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.


#3

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”.


#4

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


#5

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.

Can't start Mongo server on new 1.7 project