1

I am trying to unbox truffle-react but I am stuck with this error:

$ truffle unbox react
Downloading...
Unpacking...
Setting up...
Error: Command failed: npm install
npm WARN deprecated [email protected]: ethereumjs-testrpc has been renamed to ganache-cli, please use this package from now on.
npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
gyp ERR! build error
gyp ERR! stack Error:`C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Important documents\New folder\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 Windows_NT 6.3.9600
gyp ERR! command "E:\\Important documents\\New folder\\node.exe" "E:\\Important documents\\New folder\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Important documents\Blockchain\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! [email protected] rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2018-05-08T16_19_12_076Z-debug.log
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Important documents\New folder\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 Windows_NT 6.3.9600
gyp ERR! command "E:\\Important documents\\New folder\\node.exe" "E:\\Important documents\\New folder\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Important documents\Blockchain\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: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2018-05-08T16_19_24_891Z-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)

I tried solutions like switching back to python 2.7 as given here and some other methods like installing node gyp given here and here. Nothing is working, please help.

However, truffle unbox webpack is working neatly! Node version is 8.9.4 and OS: Windows

1
  • There's not enough info in the output. Do you have the full log generated by npm? Which version of windows are you using? What is your VisualStudio version?
    – Ismael
    May 10, 2018 at 19:18

2 Answers 2

2

I fixed it with these steps (note step 1 takes some time):

  1. Run command prompt as administrator
  2. npm install --global--production windows-build-tools
  3. npm install --global node-gyp
  4. in package.json file put this in devdependecies section:

    "deepmerge": "^2.1.0", "is-plain-object": "^2.0.4"

  5. navigate to directory of drizzle unboxes app and run npm install or npm update if you already built it

  6. npm list drizzle and if it says [email protected] then run npm i [email protected]

  7. npm i [email protected]

  8. ganache-cli -b 3

  9. Get the seed phrase that it gives you and goto MetaMask log out if your logged in then log in with seed phrase and change networks to localhost 8545. Once your in you should have 100eth

  10. then go back to terminal and do

     truffle compile
     truffle migrate
    

You should now check MetaMask your total ETH should be 99.76~ or similar.

  1. npm run start
2

Are you installing with admin rights in console? I used admin powershell to install everything on windows.

You can try rebuilding manually : node-gyp rebuild

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.