truffle-box / react-box

Truffle, Webpack and React boilerplate.
https://truffle-box.github.io/
MIT License
736 stars 251 forks source link

Command 'truffle unbox react' not working. #38

Closed matheusml closed 5 years ago

matheusml commented 6 years ago

With:

And these commands:

mkdir truffle-box-example
cd truffle-box-example
truffle unbox react

I got this weird error:

vjE0FxA= but got sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==. (2069 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
make: g++: Command not found
make: *** [keccak.target.mk:113: Release/obj.target/keccak/src/addon.o] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/mlima/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.11-300.fc27.x86_64
gyp ERR! command "/home/mlima/.nvm/versions/node/v8.9.4/bin/node" "/home/mlima/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mlima/Projects/truffle-box-example/node_modules/keccak
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keccak@1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mlima/.npm/_logs/2018-01-10T18_41_44_213Z-debug.log
make: g++: Command not found
make: *** [copied_files.target.mk:22: Release/obj.target/copied_files.node] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/mlima/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.11-300.fc27.x86_64
gyp ERR! command "/home/mlima/.nvm/versions/node/v8.9.4/bin/node" "/home/mlima/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mlima/Projects/truffle-box-example/node_modules/scrypt
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN The package dotenv is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mlima/.npm/_logs/2018-01-10T18_41_47_599Z-debug.log

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

Any ideas?

balibou commented 6 years ago
screen shot 2018-01-14 at 20 25 24

@matheusml Did you try running npm install ?

matheusml commented 6 years ago

@balibou I made an empty folder:

mkdir truffle-box-example

There's no package.json on it.

And then I run truffle-unbox-react

It's not possible to run npm install on the empty folder.

omkarkhair commented 6 years ago

I have the same error on a x64 Windows.

yyssjj33 commented 6 years ago

same here on Mac, must be something wrong with my default python version

I fix it by setting my default python version back to 2.7(https://stackoverflow.com/a/38806058)

the reason is node-gyp only support python2

@matheusml I think your problem maybe due to make or gcc

➜  tuffle-play truffle unbox react
Downloading...
Unpacking...
Setting up...
Error: Command failed: npm install
npm WARN deprecated ethereumjs-testrpc@2.2.7: ethereumjs-testrpc has been renamed to ganache-cli, please use this package from now on.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/usr/local/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:263:7)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:547:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/Users/jiyang/.nvm/versions/node/v8.6.0/bin/node" "/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jiyang/blockchain/payroll-play/node_modules/keccak
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jiyang/.npm/_logs/2018-03-22T05_48_54_025Z-debug.log
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/usr/local/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:263:7)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:547:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/Users/jiyang/.nvm/versions/node/v8.6.0/bin/node" "/Users/jiyang/.nvm/versions/node/v8.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jiyang/blockchain/payroll-play/node_modules/scrypt
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN The package dotenv is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jiyang/.npm/_logs/2018-03-22T05_48_55_897Z-debug.log

    at ChildProcess.exithandler (child_process.js:271:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Socket.stream.socket.on (internal/child_process.js:348:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:547:12)
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if no there is no reply to further comments.

karadikid commented 5 years ago

Truffle unbox drizzle fails. Issue:

56619 verbose pkgid scrypt@6.0.3 56620 verbose cwd /Users/karadi/Developer/drizzle/app 56621 verbose Darwin 18.6.0 56622 verbose argv "/Users/karadi/.nvm/versions/node/v10.16.0/bin/node" "/Users/karadi/.nvm/versions/node/v10.16.0/bin/npm" "install" 56623 verbose node v10.16.0 56624 verbose npm v6.9.0 56625 error code ELIFECYCLE 56626 error errno 1 56627 error scrypt@6.0.3 install:node-gyp rebuild 56627 error Exit status 1 56628 error Failed at the scrypt@6.0.3 install script. 56628 error This is probably not a problem with npm. There is likely additional logging output above.

Siddharth-sing commented 1 year ago

For Windows

I have a solution where we don't have to downgrade the node version and truffle-box react will be up and running. We will go old school.

Now we have to do two major things, first one is to compile & migrate the smart contracts and the next is to install the npm dependencies (because npm module doesn't go in a repo. instead package.json have all the dependencies required written.)