hardhat-starter-kit icon indicating copy to clipboard operation
hardhat-starter-kit copied to clipboard

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

Open mattaereal opened this issue 3 years ago • 2 comments

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.

mattaereal avatar Aug 02 '22 15:08 mattaereal

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?

QingyangKong avatar Aug 03 '22 07:08 QingyangKong

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:

  • Close #116
  • Refactor parts of the project that use @chainlink/test-helpers and @appliedblockchain/chainlink-contracts packages
  • Remove @chainlink/test-helpers and @appliedblockchain/chainlink-contracts packages

andrejrakic avatar Aug 11 '22 08:08 andrejrakic