smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.21k stars 491 forks source link

@ledgerheq/hw-transport-node-hid version ^4.3.0 fails on build #115

Closed mattaereal closed 1 year ago

mattaereal commented 2 years ago

Dependency @ledgerheq/hw-transport-node-hid fails on ^4.3.0 version with latest versions of yarn, node, and node-gyp.

make: *** [HID-hidraw.target.mk:120: Release/obj.target/HID-hidraw/src/HID.o] Error 1
make: Leaving directory '/tmp/test/node_modules/node-hid/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.18.15-arch1-1
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/test/node_modules/node-hid
gyp ERR! node -v v16.16.0
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok

Steps to reproduce

↪ node --version                                                                                                                                                              12:11:03
v16.16.0
matt at delleite in /t/test 
↪ yarn --version                                                                                                                                                              12:25:50
1.22.19
matt at delleite in /t/test 
↪ node-gyp --version                                                                                                                                                          12:25:54
v9.1.0
↪ mkdir node-hid-breaks
↪ cd node-hid-breaks
↪ yarn add "@ledgerhq/hw-transport-node-hid@^4.3.0"

A hotfix can be replacing line 158 of yarn.lock from "@ledgerhq/hw-transport-node-hid" "^4.3.0" to "@ledgerhq/hw-transport-node-hid" "^5.26.0" which is the next version seen in the rest of the packages.

Alternatively, you could remove hardware wallets dependencies altogether (or just ledgers', they may seem unnecessary depending on your situation).

I'll be submitting this minor modification as a pull request momentarily.

QingyangKong commented 2 years ago

Thanks for raising the issue @mattaereal. Hi @andrejrakic , can you check if @ledgerheq/hw-transport-node-hid can be removed? I don't think the dependency is used in hardhat-starter-kit?

andrejrakic commented 2 years ago

Thanks for raising this issue @mattaereal and for opening #116

The @ledgerhq/hw-transport-node-hid comes from @chainlink/test-helpers and @appliedblockchain/chainlink-contracts dependencies. The issue is minor in my opinion because that dependency is used nowhere in the harhdat-starter-kit. If we remove those two dependencies, the issue will go away, but then some tests and tasks will fail because those files need them.

I am not a fan of manually changing the .lock files since they are auto-generated for reason. I am suggesting the following approach: