How to build @metamask/eth-keyring-controller locally to edit and use as a dependency within the metamask-extension

Hello, I’m trying to fork and build the @metamask/eth-keyring-controller package locally to edit and use as a dependency within the MetaMask-extension repo. Unfortunately I’ve failed to do so.

I’ve tried linking it within the package json using yarn install <filepath> which successfully creates a link to the local module however when running yarn start on the MetaMask-extension repo it produces an error: TypeError: Tried to access an environmental variable "_nodeLRUCacheForceNoSymbol" that wasn't declared in builds.yml I did try adding the env like it says however it keeps asking for envs to add to builds.yml which ultimately doesn’t work.

I’ve also tried just putting the package directly inside the MetaMask-extension repo and change the imports to the filepath of the local package. But this caused many dependency issues.

Is there a better way to go about this? If you have any ideas I’d love to know. Thanks.

Hi @goosey thanks for reaching have you tried using Keyring API instead: Use the Keyring API from a dapp | MetaMask developer documentation

1 Like

Hi @0xroo thanks for the reply, I don’t think the Keyring API is the correct package I’m looking for. I want to add changes to the encryption and decryption functions related to the vault, within the @metamask/eth-keyring-controller package.

I just don’t know how to build and edit the package locally without it giving an error in the MetaMask-extension repo.

I understand thanks for sharing more details about your project, I see you opened as issue here too: Question: How to fork and build this package locally to edit and use within the metamask-extension · Issue #318 · MetaMask/KeyringController · GitHub please try to use only 1 channel to ask a question. Please wait for the team to reply on gh issue

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.