electron-store icon indicating copy to clipboard operation
electron-store copied to clipboard

Error: Cannot find module 'ajv/dist/compile/context'

Open augster opened this issue 4 years ago • 13 comments

I'm getting the error "Error: Cannot find module 'ajv/dist/compile/context'" Using electron-store ^7.0.0 and up. Downgraded to 6.0.1 and everything worked fine.

I installed "ajv" but the context file doesn't exist in the location specified in the error.

augster avatar Apr 19 '21 18:04 augster

Can you try the latest version? It upgrades Ajv. https://github.com/sindresorhus/electron-store/releases/tag/v8.0.0

sindresorhus avatar Apr 19 '21 19:04 sindresorhus

Looks like its missing "codegen" now. Error: Cannot find module 'ajv/dist/compile/codegen'

augster avatar Apr 19 '21 20:04 augster

Then I don't really know. I would recommend opening an issue on Ajv, as that's where the error is coming from.

sindresorhus avatar Apr 20 '21 06:04 sindresorhus

@augster I had the same problem because there seams to be a problem NPM v7 and Node v16.

I did the following steps to solve this problem:

  1. delete package-lock.json file
  2. delete node_modules folder
  3. set Node to v14.16.0
  4. set NPM to v6.14.11
  5. run npm install

lailo avatar Apr 29 '21 18:04 lailo

I think this is just an issue when using npm v7. I don't get this issue when using npm v6 and Node v16.

I still get it if I use Yarn though.

zakini avatar May 13 '21 12:05 zakini

I would like to know if there is any progress on this issue? I am using electron-store v6 as an alternative for one of my projects because of this issue.

zhshch2002 avatar Jul 05 '21 12:07 zhshch2002

I have the same problem

Mine: npm -v 6.14.5 node -v v14.5.0

sage-z avatar Jul 10 '21 11:07 sage-z

I think this is just an issue when using npm v7. I don't get this issue when using npm v6 and Node v16.

I still get it if I use Yarn though.

Indeed, I used npm and npm audit fix to solve this problem

Don't use yarn

sage-z avatar Jul 10 '21 16:07 sage-z

I'm having the same problem.

I just installed electron-store.

When I run npm start, I get:

Error: Cannot find module 'ajv/dist/compile/codegen'

george-thomas-hill avatar Jul 28 '21 23:07 george-thomas-hill

1666340861071 I'm having the same problem.

guaijie avatar Oct 21 '22 08:10 guaijie

I have the same problem, have a solution? thanks

984035589 avatar Apr 10 '23 03:04 984035589

1666340861071 I'm having the same problem.

me2

yesw6a avatar Sep 19 '23 14:09 yesw6a

Same issue here.

busybox11 avatar Mar 20 '24 23:03 busybox11