truffle unpack react fails on windows and ubuntu - needs to replace web3 version with 1.3.0

Created on 11 Dec 2020  路  11Comments  路  Source: trufflesuite/truffle

  • [x] I've asked for help in the Truffle Gitter before filing this issue.

Issue

Running truffle unpack react fails

Steps to Reproduce

truffle unpack react

Actual Results

npm ERR! code 1
npm ERR! path D:\smartcontracts\crowdsales-experiments\client\node_modules\sha3
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
npm ERR!   addon.cpp
npm ERR! d:\smartcontracts\crowdsales-experiments\client\node_modules\sha3\src\addon.cpp(49): warning C4316: 'SHA3Hash': object allocated on the heap may not be aligned 32 [D:\smartcontracts\crowdsales-experiments\client\node_modules\sha3\build\sha3.vcxproj]
npm ERR! d:\smartcontracts\crowdsales-experiments\client\node_modules\sha3\src\addon.cpp(83): error C2661: 'v8::Object::Set': no overloaded function takes 2 arguments [D:\smartcontracts\crowdsales-experiments\client\node_modules\sha3\build\sha3.vcxproj]
npm ERR! gyp info it worked if it ends with ok

Environment

  • Operating System: Windows 10 and Ubuntu 20
  • Ethereum client:
  • Truffle version (v5.1.57):
  • node version (v15.4.0):
  • npm version (7.0.15):
bug help wanted priority3 馃敡

All 11 comments

It relates to sha3 issues
When cd client and npm ci, it fails with the same error
But npm i works

I confirm the same in Ubuntu 20

image

I fixed it in Ubuntu using

"web3": "^1.3.0"

in package.json

And the same works for Windows

Please, update your truffle unpack react

Hi! We haven't updated to web3 1.3 because of this bug that was introduced in 1.2.10 but still hasn't been fixed yet. I may have to go pester them about it -- or submit a PR myself...

That could save hours for others )

@Dmdv What package.json are you editing? For the record, I just confirmed that on a mac this box has no problems unboxing successfully (aside from some ugly warnings in the console).

@eggplantzzz When unpacking crashed, I cd into client directory and edit package.json in the client directory.
After this, I run npm i to complete.

Ok thanks for reporting this @Dmdv!

Well, I submitted this PR to web3, hopefully they merge and release it before too long so we can upgrade...

It works!

Was this page helpful?
0 / 5 - 0 ratings