yanyiwu / nodejieba

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

Unable to compile on Windows 11 with node-jieba 2.5.2/2.6.0 #208

Closed WinUP closed 2 years ago

WinUP commented 2 years ago

OS: Windows 11 Visual Studio: 2022,Windows SDK 10.0.19041.0 nodejs: 17.5.0 node-gyp: 8.4.1/9.0.0

C++ error happened when install dependencies:

.../node_modules/nodejieba install$ node-pre-gyp install --fallback-to-build
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using node-pre-gyp@1.0.7
│ node-pre-gyp info using node@17.5.0 | win32 | x64
│ node-pre-gyp info check checked for "C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\build\Release\nodejieba.node" (not found)
│ node-pre-gyp http GET https://********/mirrors/nodejieba/v2.5.2/nodejieba-v2.5.2-node-v102-win32-x64.tar.gz
│ node-pre-gyp ERR! install response status 404 Not Found on https://********/mirrors/nodejieba/v2.5.2/nodejieba-v2.5.2-node-v102-win32-x64.tar.gz
│ node-pre-gyp WARN Pre-built binaries not installable for nodejieba@2.5.2 and node@17.5.0 (node-v102 ABI, unknown) (falling back to source compile with node-gyp)
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://********/mirrors/nodejieba/v2.5.2/nodejieba-v2.5.2-node-v102-win32-x64.tar.gz
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@8.4.1
│ gyp info using node@17.5.0 | win32 | x64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@8.4.1
│ gyp info using node@17.5.0 | win32 | x64
│ gyp info find Python using Python version 3.10.2 found at "C:\Users\Admin\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
│ gyp info find VS using VS2022 (17.1.32210.238) found at:
│ gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
│ gyp info find VS run with --verbose for detailed information
│ gyp info spawn C:\Users\Admin\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
│ gyp info spawn args [
│ gyp info spawn args   'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'msvs',
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\Users\\Admin\\Documents\\Projects\\Documentation\\common\\temp\\node_modules\\.pnpm\\nodejieba@2.5.2\\node_modules\\nodejieba\\build\\config.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   'C:\\Users\\Admin\\AppData\\Local\\node-gyp\\Cache\\17.5.0\\include\\node\\common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Admin\\AppData\\Local\\node-gyp\\Cache\\17.5.0',
│ gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.5.0\\\\<(target_arch)\\\\node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Admin\\Documents\\Projects\\Documentation\\common\\temp\\node_modules\\.pnpm\\nodejieba@2.5.2\\node_modules\\nodejieba',
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'C:\\Users\\Admin\\Documents\\Projects\\Documentation\\common\\temp\\node_modules\\.pnpm\\nodejieba@2.5.2\\node_modules\\nodejieba\\build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@8.4.1
│ gyp info using node@17.5.0 | win32 | x64
│ gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
│ gyp info spawn args [
│ gyp info spawn args   'build/binding.sln',
│ gyp info spawn args   '/clp:Verbosity=minimal',
│ gyp info spawn args   '/nologo',
│ gyp info spawn args   '/p:Configuration=Release;Platform=x64'
│ gyp info spawn args ]
│ �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء�
│   index.cpp
│   nodejieba.cpp
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(87,70): error C2039: "ptr_fun": ���� "std" �ij�Ա [C:\Users\Admin\Documents\Projects\Docu
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StdExtension.hpp(32): message : �μ���std�������� [C:\Users\Admin\Documents\Projects\Documentation\comm
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(87,77): error C2065: ��ptr_fun��: δ�����ı�ʶ�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(87,78): error C2062: ��������͡�unsigned int�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(92,61): error C2039: "ptr_fun": ���� "std" �ij�Ա [C:\Users\Admin\Documents\Projects\Docu
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StdExtension.hpp(32): message : �μ���std�������� [C:\Users\Admin\Documents\Projects\Documentation\comm
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(92,68): error C2065: ��ptr_fun��: δ�����ı�ʶ�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(92,69): error C2062: ��������͡�unsigned int�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(101,70): error C2039: "bind2nd": ���� "std" �ij�Ա [C:\Users\Admin\Documents\Projects\Doc
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StdExtension.hpp(32): message : �μ���std�������� [C:\Users\Admin\Documents\Projects\Documentation\comm
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(101,77): error C3861: ��bind2nd��: �Ҳ�����ʶ�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(101,27): error C2672: ��std::find_if��: δ�ҵ�ƥ������غ��� [C:\Users\Admin\Documents\Proje
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(101,104): error C2780: ��_FwdIt std::find_if(_ExPo &&,_FwdIt,const _FwdIt,_Pr) noexcept
│ C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\algorithm(348): message : �μ���std::find_if�������� [C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(101,104): error C2780: ��_InIt std::find_if(_InIt,const _InIt,_Pr)��: Ӧ���� 3 ��������ȴ
│ C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(5615): message : �μ���std::find_if�������� [C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(106,61): error C2039: "bind2nd": ���� "std" �ij�Ա [C:\Users\Admin\Documents\Projects\Doc
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StdExtension.hpp(32): message : �μ���std�������� [C:\Users\Admin\Documents\Projects\Documentation\comm
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(106,68): error C3861: ��bind2nd��: �Ҳ�����ʶ�� [C:\Users\Admin\Documents\Projects\Docume
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(106,16): error C2672: ��std::find_if��: δ�ҵ�ƥ������غ��� [C:\Users\Admin\Documents\Proje
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(106,95): error C2780: ��_FwdIt std::find_if(_ExPo &&,_FwdIt,const _FwdIt,_Pr) noexcept�
│ C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\algorithm(348): message : �μ���std::find_if�������� [C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@
│ C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba\deps\limonp\StringUtil.hpp(106,95): error C2780: ��_InIt std::find_if(_InIt,const _InIt,_Pr)��: Ӧ���� 3 ��������ȴ�
│ C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include\xutility(5615): message : �μ���std::find_if�������� [C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@
│ gyp ERR! build error
│ gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
│ gyp ERR! stack     at ChildProcess.onExit (C:\Users\Admin\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
│ gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
│ gyp ERR! System Windows_NT 10.0.22000
│ gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Admin\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Admin\\Documents\\Projects\\Documentation\
│ gyp ERR! cwd C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba
│ gyp ERR! node -v v17.5.0
│ gyp ERR! node-gyp -v v8.4.1
│ gyp ERR! not ok
│ node-pre-gyp ERR! build error
│ node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Admin\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Admin\Documents\Projects\Documen
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\@mapbox+node-pre-gyp@1.0.7\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1090:16)
│ node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
│ node-pre-gyp ERR! System Windows_NT 10.0.22000
│ node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Admin\\Documents\\Projects\\Documentation\\common\\temp\\node_modules\\.pnpm\\@mapbox+node-pre-gyp@1.0.7\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre
│ node-pre-gyp ERR! cwd C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules\.pnpm\nodejieba@2.5.2\node_modules\nodejieba
│ node-pre-gyp ERR! node -v v17.5.0
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.7
│ node-pre-gyp ERR! not ok
│ Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Admin\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Admin\Documents\Projects\Documentation\common\temp\node_modules
└─ Failed in 11.8s
WinUP commented 2 years ago

PS: Downgrade to node 16 could solve this issue.

Fucntion commented 2 years ago

这个仓库的构建流程失效了,降级使用吧。

rbirkgit commented 2 years ago

I have similar issue with Node 18. Is the bug here, Node or with node-pre-gyp?