yanyiwu / nodejieba

"结巴"中文分词的Node.js版本
MIT License
3.07k stars 279 forks source link

build error on windows x64 #10

Closed nihgwu closed 10 years ago

nihgwu commented 10 years ago

184 error node -v v0.10.29 185 error npm -v 1.4.16 186 error code ELIFECYCLE 187 verbose exit [ 1, true ]

yanyiwu commented 10 years ago

@nihgwu 你好,虽然我自己没在 windows 上测试过,但是如果你能贴详细错误的话,或许我能尝试看看能不能帮上忙。

nihgwu commented 10 years ago
D:\>cnpm install nodejieba

> nodejieba@0.2.4 install D:\node_modules\nodejieba
> node-gyp rebuild

D:\node_modules\nodejieba>node "C:\Users\sdmx\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。                                                                                                                                                                                                                                                 
  segment.cpp
  mix_segment.cpp
  query_segment.cpp
D:\node_modules\nodejieba\node_modules\nan\nan.h(1185): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                
D:\node_modules\nodejieba\node_modules\nan\nan.h(1185): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                    
D:\node_modules\nodejieba\node_modules\nan\nan.h(1185): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                              
D:\node_modules\nodejieba\node_modules\nan\nan.h(1202): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                
D:\node_modules\nodejieba\node_modules\nan\nan.h(1202): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                    
D:\node_modules\nodejieba\node_modules\nan\nan.h(1202): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                              
D:\node_modules\nodejieba\node_modules\nan\nan.h(1215): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                              
D:\node_modules\nodejieba\node_modules\nan\nan.h(1215): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                  
D:\node_modules\nodejieba\node_modules\nan\nan.h(1215): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                            
D:\node_modules\nodejieba\node_modules\nan\nan.h(1229): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                              
D:\node_modules\nodejieba\node_modules\nan\nan.h(1229): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                  
D:\node_modules\nodejieba\node_modules\nan\nan.h(1229): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                            
D:\node_modules\nodejieba\node_modules\nan\nan.h(1318): warning C4244: “return”: 从“intptr_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                         
D:\node_modules\nodejieba\node_modules\nan\nan.h(1318): warning C4244: “return”: 从“intptr_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                       
D:\node_modules\nodejieba\node_modules\nan\nan.h(1318): warning C4244: “return”: 从“intptr_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                             
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                             
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                 
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                           
d:\node_modules\nodejieba\src\utils.h(16): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                            
d:\node_modules\nodejieba\src\utils.h(16): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                                
d:\node_modules\nodejieba\src\utils.h(16): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                          
d:\node_modules\nodejieba\src\utils.h(18): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                       
d:\node_modules\nodejieba\src\utils.h(18): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                           
d:\node_modules\nodejieba\src\utils.h(18): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                                                                     
d:\node_modules\nodejieba\src\cppjieba\limonp\StdExtension.hpp(10): fatal error C1083: 无法打开包括文件: “tr1/unordered_map”: No such file or directory (..\src\query_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                       
d:\node_modules\nodejieba\src\cppjieba\limonp\StdExtension.hpp(10): fatal error C1083: 无法打开包括文件: “tr1/unordered_map”: No such file or directory (..\src\segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                             
d:\node_modules\nodejieba\src\cppjieba\limonp\StdExtension.hpp(10): fatal error C1083: 无法打开包括文件: “tr1/unordered_map”: No such file or directory (..\src\mix_segment.cpp) [D:\node_modules\nodejieba\build\segment.vcxproj]                                                                                         
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\sdmx\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\sdmx\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\node_modules\nodejieba
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! nodejieba@0.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejieba@0.2.4 install script.
npm ERR! This is most likely a problem with the nodejieba 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 their info via:
npm ERR!     npm owner ls nodejieba
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "node" "C:\\Users\\sdmx\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npm\\bin\\npm-cli.js" "--userconfig=C:\\Users\\sdmx\\.cnpmrc" "--disturl=http://npm.taobao.org/dist" "--cache=C:\\Users\\sdmx\\.npm\\.cache_cnpm" "--registry=http://registry.npm.taobao.org" "install" "nodejieba
"
npm ERR! cwd D:\
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.16
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\npm-debug.log
npm ERR! not ok code 0
yanyiwu commented 10 years ago

编译器选项开启c++11试试?-std=c++11 或者 -std=c++0x

mrjoth commented 8 years ago

vs not support c++11!!