Import fails on MacOS with Node 12
See original GitHub issueI’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:
- Checkout ganache-core on a Mac with Node 12
 yarnyarn buildyarn test
Context
I use ganache-core as a web3 provider in Truffle for testing.
Your Environment
- Version used: latest develop (cba166610008262266a60908d7ab4eb20fd856be)
 - Environment name and version: Node 12.1.0
 - Operating System and version: MacOS Mojave
 - Link to your project: https://github.com/sustainablesource/sustainablesource
 
Issue Analytics
- State:
 - Created 4 years ago
 - Reactions:1
 - Comments:11 (8 by maintainers)
 
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for this! These abandoned native transitive deps have been quite the headache for many projects here at Truffle!
Thanks! Works like a charm.