yanyiwu / nodejieba

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

windows下安装报错退出 #27

Closed zuoRambo closed 9 years ago

zuoRambo commented 9 years ago
G:\syntun>npm install -g  nodejieba
npm http GET https://registry.npmjs.org/nodejieba
npm http 304 https://registry.npmjs.org/nodejieba
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan

> nodejieba@1.0.1 install C:\Users\Rambo\AppData\Roaming\npm\node_modules\nodejieba
> node-gyp rebuild

C:\Users\Rambo\AppData\Roaming\npm\node_modules\nodejieba>node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp
\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  index.cpp
  nodejieba.cpp
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(17): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(17): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(19): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(24): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(19): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(24): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(30): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(35): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(41): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(30): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(35): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 [C:\Users\
Rambo\AppData\Roam
ing\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\utils.h(41): warning C4267: “参数”: 从“size_t”转换到“uint32_t”,可能丢失数据 [C:\U
sers\Rambo\AppData
\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\cppjieba\limonp\StdExtension.hpp(13): fatal error C1083: 无法打开包括文件:“tr1/unordere
d_map”:
No such file or directory [C:\Users\Rambo\AppData\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
c:\users\rambo\appdata\roaming\npm\node_modules\nodejieba\lib\cppjieba\limonp\StdExtension.hpp(13): fatal error C1083: 无法打开包括文件:“tr1/unordere
d_map”:
No such file or directory [C:\Users\Rambo\AppData\Roaming\npm\node_modules\nodejieba\build\nodejieba.vcxproj]
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 (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Rambo\AppData\Roaming\npm\node_modules\nodejieba
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! nodejieba@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejieba@1.0.1 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 "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "nodejieba"
npm ERR! cwd G:\syntun
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     G:\syntun\npm-debug.log
npm ERR! not ok code 0

希望能支持windows

yanyiwu commented 9 years ago

感谢你反馈的这个问题,是可以支持windows的,这个兼容性问题我在 nodejieba@1.0.2 里面已修复,但是一些 npm publish 失败,可能是 npm 官方服务端那边有问题。稍后我再publish试试。 还有, nodejieba@1.0.2 已经用 npm pack 打包了一份 nodejieba-1.0.2.tgz,发到你的gmail邮箱了。 你可以直接下载下来,用 npm install -g nodejieba-1.0.2.tgz 试试。

zuoRambo commented 9 years ago

@yanyiwu 多谢回复 看了两小时yanyiwu.com/ 博客了 备受鼓舞

yanyiwu commented 9 years ago

@zuoRambo 谢谢! 刚才已经 npm publish 成功了,我错怪npm官方服务了,是我自己的机器的诡异问题,重启了一下就OK了。

你可以 npm install nodejieba@1.0.2 试试