我已经搜索了堆栈溢出,其中包含有关node-gyp的其他有用建议以及https://github.com/nodejs/node-gyp中讨论的先决条件,但仍然存在此构建错误:
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
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\bajor\Desktop\Development\hackathon-starter\node_modules\secp256k1
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "rebuild"
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! secp256k1@3.1.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the secp256k1@3.1.0 rebuild script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the secp256k1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs secp256k1
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls secp256k1
npm ERR! There is likely additional logging output above.
这是我的设置:
当尝试其他需要node-gyp的软件包(例如node-sass)时,没有构建问题,但是使用secp256k1我遇到了问题。
此外,我在错误发生之前多次收到相同的警告:
warning C4267: '=': conversion from 'size_t' to '
unsigned char', possible loss of data (compiling source file ..\src\secp256k1-src\s
rc\secp256k1.c)