OpenZeppelin / openzeppelin-sdk

OpenZeppelin SDK repository for CLI and upgrades.js. No longer actively developed.
MIT License
431 stars 200 forks source link

openzeppelin init project comes back with Cannot find module 'scrypt-shim' #1554

Closed bitcoinwarrior1 closed 4 years ago

bitcoinwarrior1 commented 4 years ago

Hi All,

I successfully installed openzeplin-cli via

$ npm install --global @openzeppelin/cli

I created a new project and ran

$ openzeppelin init project-name

which creates the following error:

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

Error: Cannot find module 'scrypt-shim' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (/usr/local/lib/node_modules/@openzeppelin/cli/node_modules/web3-eth-accounts/src/index.js:34:14) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3)

$ npm -v 6.4.1

node -v v10.13.0

abcoathup commented 4 years ago

Hi @James-Sangalli!

I’m sorry that you had this issue.

We have been able to reproduce this issue by following these steps: Using nvm (node version manager) to revert to node v10.13.0

$ nvm install v10.13.0
$ nvm use v10.13.0
$ npm install --global @openzeppelin/cli
$ openzeppelin init project-name

You can use the following workaround: Update to a later version of node 10 I used node v10.21.0

bitcoinwarrior1 commented 4 years ago

@abcoathup working, thank you very much for your help!

LorenzoZaccagnini commented 4 years ago

Same happens with the lastest node 12.18.1

Cannot find module 'scrypt-shim'