我试图在几天内在win10上安装node-protobuf。我已经跟随了一些quides/readmes,如何去做,但没有成功。现在我卡在这里:node.js在windows10上安装node-protobuf
C:\rie>npm install node-protobuf
/
> [email protected] install C:\rie\node_modules\node-protobuf
> node-gyp rebuild
C:\rie\node_modules\node-protobuf>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (node "" rebuild)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
init.cpp
native.cpp
parse.cpp
serialize.cpp
c:\rie\node_modules\node-protobuf\src\common.h(11): fatal error C1083: Cannot open include file: 'google/protobuf/descriptor.h': No suc
h file or directory (compiling source file ..\src\native.cpp) [C:\rie\node_modules\node-protobuf\build\protobuf.vcxproj]
c:\rie\node_modules\node-protobuf\src\common.h(11): fatal error C1083: Cannot open include file: 'google/protobuf/descriptor.h': No suc
h file or directory (compiling source file ..\src\serialize.cpp) [C:\rie\node_modules\node-protobuf\build\protobuf.vcxproj]
c:\rie\node_modules\node-protobuf\src\common.h(11): fatal error C1083: Cannot open include file: 'google/protobuf/descriptor.h': No suc
h file or directory (compiling source file ..\src\parse.cpp) [C:\rie\node_modules\node-protobuf\build\protobuf.vcxproj]
c:\rie\node_modules\node-protobuf\src\common.h(11): fatal error C1083: Cannot open include file: 'google/protobuf/descriptor.h': No suc
h file or directory (compiling source file ..\src\init.cpp) [C:\rie\node_modules\node-protobuf\build\protobuf.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\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:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200: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:\rie\node_modules\node-protobuf
gyp ERR! node -v v4.4.5
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" "install" "node-protobuf"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
在centos上,没有问题。
我想,MS-工具都OK。我用“npm install --global --production windows-build-tools”安装了MS Visual C++ Build Tools。问题可能是“编译libprotobuf”。我可以找到它,但如何编译它? – ajlind