Error: Cannot find module 'scrypt-shim'

Hi,
I’m having a similar issue so I’m replying on this topic (Got Cannot find module `./build/Release/scrypt` when run `npm run test`) instead of opening a new one.
I was updating dependencies from an older version of zos-lib to the new openzeppelin packages.
I cleaned everything, including the deletion of node_modules and package-lock.
Then I installed the new packages, but I’m having this error:

internal/modules/cjs/loader.js:670
throw err;
^

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/lucianosilvi/blockchain_dev/truffle_project/node_modules/web3-eth-accounts/src/index.js:34:14)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)

I even tried installing the deprecated scrypt-shim package, but the issue persists.

Packages versions:
NPM: 6.7
Node: 11.15
solc 0.6.10
web3 1.2.9
truffle 5.1.32
@openzeppelin/cli 2.8.2

Ubuntu 16.04

Do you know how to fix it?
Thanks

1 Like

Hi @lucianosilvi,

Sorry for the late reply, I was on vacation last week.

I have moved to a new topic as it is easier to track.

What were you running when this occurred?

A similar error was reported in: Cannot find module 'scrypt-shim' when using OpenZeppelin Test Environment

Can you try using node 10, you will need to remove node_modules and package-lock.json