OpenZeppelin / openzeppelin-sdk

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

npx oz init results in error "Cannot find module 'scrypt-shim'" using node 11 #1566

Closed abcoathup closed 4 years ago

abcoathup commented 4 years ago

npx oz init results in error "Cannot find module 'scrypt-shim'" using node v11.15

$ npm init -y
$ npm i @openzeppelin/cli
$ npx oz init
Cannot find module 'scrypt-shim'

Environment: Windows Subsystem for Linux 2 on Windows 10

$ node --version
v11.15.0
$ npm --version
6.7.0

Work around change to node 10 and remove node_modules and package-lock.json:

$ nvm use v10
Now using node v10.21.0 (npm v6.14.5)
$ rm -rf node_modules/ package-lock.json
$ npm install
$ npx oz init
? Welcome to the OpenZeppelin SDK! Choose a name for your project node11
? Initial project version 1.0.0
Project initialized. Write a new contract in the contracts folder and run 'openzeppelin deploy' to deploy it.
ialberquilla commented 4 years ago

I have the same error with node v10:

$ nvm current
v10.10.0
$ npm install
$ npx oz init

Cannot find module 'scrypt-shim'

I'm using ubuntu 18.04. Is there any workaround?

abcoathup commented 4 years ago

Hi @ialberquilla,

I was able to reproduce the error using node v10.10.0. Changing to the latest node v10 meant I didn't get the issue.

$ nvm install v10
$ nvm current
v10.21.0
$ npm init -y
$ npm i @openzeppelin/cli
$ npx oz init
? Welcome to the OpenZeppelin SDK! Choose a name for your project
ialberquilla commented 4 years ago

Thanks @abcoathup

abcoathup commented 4 years ago

I am closing this issue as node 11 is no longer supported. We should use either node 10 or node 12.

https://nodejs.org/en/about/releases/ Major Node.js versions enter Current release status for six months, which gives library authors time to add support for them. After six months, odd-numbered releases (9, 11, etc.) become unsupported, and even-numbered releases (10, 12, etc.) move to Active LTS status and are ready for general use. LTS release status is "long-term support", which typically guarantees that critical bugs will be fixed for a total of 30 months. Production applications should only use Active LTS or Maintenance LTS releases.