A truffle test needs ethereumjs-wallet

const wallet = require('ethereumjs-wallet');

I tried

npm install ethereumjs-wallet

and even

npm uninstall ethereumjs-wallet
npm install --save [email protected]

but ethereumjs-wallet is not listed on npm ls

When installing this is the result:

> [email protected] preinstall C:\Users\jj\node_modules\scrypt
> node node-scrypt-preinstall.js

> [email protected] install C:\Users\jj\node_modules\scrypt
> node-gyp rebuild

C:\Users\jj\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files
\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Warning: Missing input files:
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\jj\node_modules\scrypt\build\copied_files.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Users\jj\node_modules\scrypt\build\scrypt_wrapper.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.C
pp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
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 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262: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.1.7600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jj\node_modules\scrypt
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jj\package.json'
npm WARN jj No description
npm WARN jj No repository field.
npm WARN jj No README data
npm WARN jj No license field.

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\jj\AppData\Roaming\npm-cache\_logs\2018-10-23T07_46_40_388Z-debug.log
  • 1
    Have you tried adding it in your package.json file? Commented Oct 23, 2018 at 8:10
  • No, I didn't, why should I? I thought "npm install ethereumjs-wallet" would be enough... isn't it? Commented Oct 23, 2018 at 8:27
  • 2
    Best if you list all your dependencies in package.json and then just do npm install. Commented Oct 23, 2018 at 8:29
  • From the error message one of the dependencies scrypt fails to install. Make sure the compiler required by node-gyp is correctly configured github.com/nodejs/node-gyp#on-windows.
    – Ismael
    Commented Oct 26, 2018 at 4:58
  • 3
    Possible duplicate of Error in unboxing truffle-react
    – Ismael
    Commented Oct 31, 2018 at 5:06

2 Answers 2


Looks like it requires truffle-hd-wallet-provider.

Try: npm uninstall ethereumjs-wallet npm uninstall truffle-hdwallet-provider npm install --save [email protected] npm install --save [email protected]

And then yeah, add these to package.json

  • Sorry, it didn't work. Still same error, "Cannot find module 'ethereumjs-wallet'" Commented Oct 23, 2018 at 8:37

I found that putting the --save at the end of the command worked for me. having it in the middle did not work.

npm install [email protected] --save

Your Answer

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

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