question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import fails on MacOS with Node 12

See original GitHub issue

I’m unable to use ganache-core on MacOS with Node 12. I seem to have hit a combination of #297 (optional depencency on scrypt is not so optional) and https://github.com/barrysteyn/node-scrypt/issues/192 (scrypt doesn’t and will never work on MacOS and Node 12).

Expected Behavior

When I import ganache-core, I expect no errors.

Current Behavior

I see the following error:

Error: Cannot find module 'scrypt'
Require stack:
- /Users/mark/Development/ganache-core/node_modules/web3-eth-accounts/node_modules/scrypt.js/node.js
- /Users/mark/Development/ganache-core/node_modules/web3-eth-accounts/src/index.js
- /Users/mark/Development/ganache-core/node_modules/web3-eth/src/index.js
- /Users/mark/Development/ganache-core/build/ganache.core.node.js
- /Users/mark/Development/ganache-core/index.js
etc..

Possible Solution

Updating ethereumjs-wallet and web3 to the latest versions should remove the dependency on scrypt.

Steps to Reproduce (for bugs)

Luckily the problem also manifests itself when running the unit tests of ganache-core, so the steps to reproduce are simple:

  1. Checkout ganache-core on a Mac with Node 12
  2. yarn
  3. yarn build
  4. yarn test

Context

I use ganache-core as a web3 provider in Truffle for testing.

Your Environment

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
davidmurdochcommented, May 20, 2019

Thanks for this! These abandoned native transitive deps have been quite the headache for many projects here at Truffle!

2reactions
markspanbroekcommented, Jul 15, 2019

Thanks! Works like a charm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SecPKCS12Import is failing to import P12 certificate.
When trying to import a P12 certificate using the API SecPKCS12Import, it is failing with error errSecDecode = -26275 since 09/23 in production....
Read more >
Importing in Node.js: error "Must use import to load ES Module"
The problem is that Node.js does not currently support import and export natively yet. It is still experimental according ...
Read more >
Process | Node.js v19.3.0 Documentation
The process object provides information about, and control over, the current Node.js process. import process from 'node:process'; ...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
you're trying to import an item from a module you don't have installed in your project directory; you're importing some things from an...
Read more >
node-sass - npm
Wrapper around libsass. Latest version: 8.0.0, last published: 2 months ago. Start using node-sass in your project by running `npm i ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found