松露测试需要电子钱包。
const wallet = require('ethereumjs-wallet');
我试过了
npm install ethereumjs-wallet
甚至
npm uninstall ethereumjs-wallet
npm install --save ethereumjs-wallet@0.6.0
但电子钱包并没有被列在npm ls上。
在安装时,结果是:
> scrypt@6.0.3 preinstall C:\Users\jj\node_modules\scrypt
> node node-scrypt-preinstall.js
> scrypt@6.0.3 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:
C:\Users\jj\node_modules\scrypt\build\..\scrypt\win\include\config.h
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! 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! C:\Users\jj\AppData\Roaming\npm-cache\_logs\2018-10-23T07_46_40_388Z-debug.log
发布于 2018-10-23 08:32:25
看起来它需要truffle-hd-wallet-provider
。
尝试:npm uninstall ethereumjs-wallet npm uninstall truffle-hdwallet-provider npm install --save ethereumjs-wallet@0.6.0 npm install --save truffle-hdwallet-provider@0.0.3
然后是的,把这些加入package.json
发布于 2021-09-16 14:12:59
我发现把它放在中间是行不通的。
npm安装ethereumjs钱包@0.6.5-保存
https://ethereum.stackexchange.com/questions/61043
复制相似问题