trufflesuite / drizzle

Reactive Ethereum dapp UI suite
905 stars 235 forks source link

cannot install drizzle on macos and windows #46

Open GiovanniCapizzi opened 4 years ago

GiovanniCapizzi commented 4 years ago

I can't add drizzle to my project because of scrypt module which fails to build. Already found this, and it seems to happen with NodeJs 12. I wouldn't like to try with Node10 because scrypt doesn't seems to be manteined anymore, is there hope for new fix soon?

# define NAN_DEPRECATED __attribute__((deprecated))
                                      ^
8 warnings and 7 errors generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/12.11.1/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/12.11.1/bin/node" "/usr/local/Cellar/node/12.11.1/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
[...]
gyp ERR! node -v v12.11.1
jklepatch commented 4 years ago

This does not seem to be a problem with Drizzle directly, but with the scrypt dependency of web3.

Not sure to understand why you don't want to try with NodeJS 10. NodeJS is the LTS (Long Term Support) version of NodeJS and for most cases it's the recommended version.

GiovanniCapizzi commented 4 years ago

Yes, I am sorry, I was not so clear, my request was addressed to know if this dependency would be upgraded soon, Scrypt has been deprecated, so if I downgrade NodeJS, it would work only for that version and I won't be able to upgrade only for one package, in the future. I asked for future maintainability of a new project.

UPDATE: I didn't see that was a web3 dependency, sorry.

jklepatch commented 4 years ago

Can you try with the latest version of Drizzle(in your package.json you can point to the latest commit of this repo).

Drizzle has updated to web31.2.1` (not released to npm yet), and it might solve your problem.

GiovanniCapizzi commented 4 years ago

With yarn or npm I get this error: error Can't add "root": invalid package version undefined. Is it because package.json doesn't not specify a version?

jklepatch commented 4 years ago

What did you put exactly in your package.json?

GiovanniCapizzi commented 4 years ago

I tried with "yarn add" command. Same result if I put "package":"git://...#commit" in the package.json.

If I install it with NPM it gets a webpack error. I can't put any logs here because I am without my laptop right now, sorry.

cds-amal commented 4 years ago

@GiovanniCapizzi can you provide a repo that demonstrates the issue? It would be helpful for us to investigate.

GiovanniCapizzi commented 4 years ago

Just following this tutorial. If you want to reproduce the issue just create a simple node (12) project (like react) and issue the yarn add command. If you want I can prepare and upload a repo for you, just let me know.

cds-amal commented 4 years ago

Hi @GiovanniCapizzi,

Interesting that it fails on node v12.x.x for both Windows and OS X. Can you specify some details about your environment to help us reproduce this issue?

Thanks in advance!

msicilia commented 4 years ago

I have same issue with MacOS Catalina 10.15.

I know I can revert to Node 10 and it works, but it would be great to have a fix for Node 12 soon.

Many thanks in advance.

cds-amal commented 4 years ago

Thank you @msicilia, this is quite helpful!

GiovanniCapizzi commented 4 years ago

Really sorry I forgot to answer due to work. On MacOS with Catalina now, my Node version is v12.11.1. On Windows I have 12.10.0 without using WSL. No particularly environment used, just the windows-build-tools installed in Node to build stuffs.

cds-amal commented 4 years ago

Thanks @GiovanniCapizzi ! I'll work on reproducing this on OS X with your versions. Please note, that for now, we only support WSL windows build environment.

GiovanniCapizzi commented 4 years ago

This does not seem to be a problem with Drizzle directly, but with the scrypt dependency of web3.

Not sure to understand why you don't want to try with NodeJS 10. NodeJS is the LTS (Long Term Support) version of NodeJS and for most cases it's the recommended version.

NodeJS just updated the LTS version, now we have 12.13.0 LTS in just few days 😆

adrianmcli commented 4 years ago

@GiovanniCapizzi

I ran the following under Node v12.13.0 on MacOS 10.14.6 (Mojave) and it worked fine:

yarn init -y
yarn add @drizzle/store @drizzle/react-plugin @drizzle/react-components

That being said, I did get a similar error on v13.0.1:

1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/adrianli/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/adrianli/n/bin/node" "/Users/adrianli/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/adrianli/dev/temp/node_modules/sha3

However, this seems to be because of some libraries Web3.js is using. I've made an issue here: https://github.com/ethereum/web3.js/issues/3181

GiovanniCapizzi commented 4 years ago

Maybe this is caused by the same web3.js which could use this deprecated module. I will try again updating my node version.

WARNING!!! This module is deprecated. Instead, use https://nodejs.org/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback

theabdulmateen commented 4 years ago

So is there a fix, I have been struggling with the same error. can't find a fix or a workaround that works anymore.

Thanks

Suedo commented 3 years ago

Same problem.

Environment:

Ubuntu 20.04 on windows via WSL2. 
Node version : 12.19.0

I get the error when I use npm install -g drizzle

However, following the link that OP provided, when I use the command npm install -g @drizzle/store , I no longer face any issues.

Are we supposed to install @drizzle/store if we want to use drizzle? Asking because the page on truffle suite says drizzle

image


Update

It seems like @drizzle/store is the way to go. The Drizzle QuickStart page says to use npm install --save @drizzle/store. I guess you guys should update the Truffle Suite page ?