Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Broken dependency coming from web3 #126

Closed
dmihal opened this issue Jul 9, 2020 · 9 comments
Closed

Broken dependency coming from web3 #126

dmihal opened this issue Jul 9, 2020 · 9 comments

Comments

@dmihal
Copy link

dmihal commented Jul 9, 2020

When I try to run my tests, i get this:

Error: Cannot find module 'scrypt-shim'

This appears to come from web3: web3/web3.js#3210

This library has a fixed webpack version 1.2.2. Updating the version or making it a peer dependency should resolve this issues.

@ylv-io
Copy link
Contributor

ylv-io commented Jul 9, 2020

He @dmihal ! Thanks for reporting the issue. I am a bit confused. You mentioned webpack a couple times in your post but test-env doesn't use webpack at all. Do you mean web3 library instead?

@dmihal dmihal changed the title Broken dependency coming from webpack Broken dependency coming from web3 Jul 10, 2020
@dmihal
Copy link
Author

dmihal commented Jul 10, 2020

Thanks @ylv-io, that seems to be a typo on my part. I've changed it to web3.

@abcoathup
Copy link
Contributor

abcoathup commented Jul 15, 2020

Hi @dmihal! I’m sorry that you had this issue. We would need more information so that we can reproduce it.

Can you advise the operating system, node and npm versions that you are using? Any other details that might help us reproduce it would be appreciated!

I tried reproducing with a simple environment on WSL2 but didn't get any errors.
This was also reported by another community member in the community forum:
https://forum.openzeppelin.com/t/cannot-find-module-scrypt-shim-when-using-openzeppelin-test-environment/3147

Update

I have been able to reproduce this issue by following these steps:
Using node v11.15.0 with truffle and OpenZeppelin Test Environment installed tests fail with Cannot find module 'scrypt-shim'

$ npm run test

> [email protected] test /home/abcoathup/projects/forum/issue126
> mocha --exit --recursive test


Error: Cannot find module 'scrypt-shim'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
    at Function.Module._load (internal/modules/cjs/loader.js:591:27)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/abcoathup/projects/forum/issue126/node_modules/web3/node_modules/web3-eth-accounts/src/index.js:34:14)
...

Thanks so much for reporting it! The project owner will review and triage this issue as soon as they can. In the meantime, you can try the following workaround:

Change to use node 10
Need to remove node_modules and package-lock.json before running npm install again

@frangio
Copy link
Contributor

frangio commented Jul 17, 2020

Can this issue be reproduced in Node 10 or 12?

@abcoathup
Copy link
Contributor

I wasn't able to reproduce in node v10.21.0 or node v12.18.2
I could only reproduce in node 11 which is no longer a node supported release.

@frangio
Copy link
Contributor

frangio commented Jul 21, 2020

Okay. Thank you! Closing this issue then.

@frangio frangio closed this as completed Jul 21, 2020
@lyledavids
Copy link

Hi, I am getting the same error. Node v10.15.3
Any fix yet

@arseneeth
Copy link

Having the same issue with Node v10.6.0

@frangio
Copy link
Contributor

frangio commented Oct 5, 2020

@lyledavids @arsenyjin Can you try upgrading your Node version to 10.21.0?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants