Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个二进制包似乎需要网络或者梯子才能下载成功,请问这个二进制文件可以根据平台不同预先下载好放在项目本地,然后通过环境变量或者入参指定文件位置吗 #942

Open
latel opened this issue Feb 26, 2025 · 6 comments

Comments

@latel
Copy link

latel commented Feb 26, 2025

Lockfile is up to date, resolution step is skipped
Packages: +854
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 854, reused 854, downloaded 0, added 0, done
node_modules/.pnpm/[email protected]/node_modules/opencc: Running install script, failed in 1.4s
.../[email protected]/node_modules/opencc install$ node-pre-gyp install --fallback-to-build || node-pre-gyp re…
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using [email protected]
│ node-pre-gyp info using [email protected] | linux | x64
│ node-pre-gyp info check checked for "/home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc…
│ node-pre-gyp http GET https://github.com/BYVoid/OpenCC/releases/download/1.1.8/opencc-v1.1.8-node-v115-…
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/BYVoid/OpenCC/releases/do…
│ node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v115 ABI, …
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/BYVoid/OpenCC/releases/…
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info ok 
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info find Python using Python version 3.6.9 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node…
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc/build/config.gy…
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node…
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/.cache/node-gyp/20.18.1/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_root_dir=/home/wlq/.cache/node-gyp/20.18.1',
│ gyp info spawn args '-Dnode_gyp_dir=/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/no…
│ gyp info spawn args '-Dnode_lib_file=/home/wlq/.cache/node-gyp/20.18.1/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/open…
│ 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 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ Traceback (most recent call last):
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_…
│     import gyp  # noqa: E402
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     import gyp.input
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     import gyp.common
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     if CC := os.environ.get("CC_target") or os.environ.get("CC"):
│            ^
│ SyntaxError: invalid syntax
│ gyp ERR! configure error 
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack at ChildProcess.<anonymous> (/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm…
│ gyp ERR! stack at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
│ gyp ERR! System Linux 5.15.167.4-microsoft-standard-WSL2
│ gyp ERR! command "/home/wlq/.nvm/versions/node/v20.18.1/bin/node" "/home/wlq/.nvm/versions/node/v20.18.…
│ gyp ERR! cwd /home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc
│ gyp ERR! node -v v20.18.1
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! not ok 
│ node-pre-gyp ERR! build error 
│ node-pre-gyp ERR! stack Error: Failed to execute '/home/wlq/.nvm/versions/node/v20.18.1/bin/node /home/…
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/wlq/main/node_modules/.pnpm/@mapbox+node…
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1104:16)
│ node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
│ node-pre-gyp ERR! System Linux 5.15.167.4-microsoft-standard-WSL2
│ node-pre-gyp ERR! command "/home/wlq/.nvm/versions/node/v20.18.1/bin/node" "/home/wlq/main/node_modules…
│ node-pre-gyp ERR! cwd /home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc
│ node-pre-gyp ERR! node -v v20.18.1
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.11
│ node-pre-gyp ERR! not ok 
│ Failed to execute '/home/wlq/.nvm/versions/node/v20.18.1/bin/node /home/wlq/.nvm/versions/node/v20.18.1…
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using [email protected]
│ node-pre-gyp info using [email protected] | linux | x64
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info ok 
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info find Python using Python version 3.6.9 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node…
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc/build/config.gy…
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node…
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/wlq/.cache/node-gyp/20.18.1/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_root_dir=/home/wlq/.cache/node-gyp/20.18.1',
│ gyp info spawn args '-Dnode_gyp_dir=/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/no…
│ gyp info spawn args '-Dnode_lib_file=/home/wlq/.cache/node-gyp/20.18.1/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/open…
│ 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 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ Traceback (most recent call last):
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_…
│     import gyp  # noqa: E402
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     import gyp.input
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     import gyp.common
│   File "/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pyli…
│     if CC := os.environ.get("CC_target") or os.environ.get("CC"):
│            ^
│ SyntaxError: invalid syntax
│ gyp ERR! configure error 
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack at ChildProcess.<anonymous> (/home/wlq/.nvm/versions/node/v20.18.1/lib/node_modules/pnpm…
│ gyp ERR! stack at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
│ gyp ERR! System Linux 5.15.167.4-microsoft-standard-WSL2
│ gyp ERR! command "/home/wlq/.nvm/versions/node/v20.18.1/bin/node" "/home/wlq/.nvm/versions/node/v20.18.…
│ gyp ERR! cwd /home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc
│ gyp ERR! node -v v20.18.1
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! not ok 
│ node-pre-gyp ERR! build error 
│ node-pre-gyp ERR! stack Error: Failed to execute '/home/wlq/.nvm/versions/node/v20.18.1/bin/node /home/…
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/wlq/main/node_modules/.pnpm/@mapbox+node…
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1104:16)
│ node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
│ node-pre-gyp ERR! System Linux 5.15.167.4-microsoft-standard-WSL2
│ node-pre-gyp ERR! command "/home/wlq/.nvm/versions/node/v20.18.1/bin/node" "/home/wlq/main/node_modules…
│ node-pre-gyp ERR! cwd /home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc
│ node-pre-gyp ERR! node -v v20.18.1
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.11
│ node-pre-gyp ERR! not ok 
│ Failed to execute '/home/wlq/.nvm/versions/node/v20.18.1/bin/node /home/wlq/.nvm/versions/node/v20.18.1…
└─ Failed in 1.4s at /home/wlq/main/node_modules/.pnpm/[email protected]/node_modules/opencc
 ELIFECYCLE  Command failed with exit code 1.
@latel
Copy link
Author

latel commented Feb 26, 2025

看来似乎不是需要梯子,是根本没有对应的预编译的包 :sad,
而且现在npm publish的文件,根本本地编译通过不了,因为data下面缺少了些scripts没有被发布到npm registry上

@latel
Copy link
Author

latel commented Feb 27, 2025

I built [email protected] on abi 115(nodejs 20) for win32 x64, linux x64 and darwin arm64. In case anyone need it.

opencc-v1.1.8-node-v115-linux-x64.tar.gz
opencc-v1.1.8-node-v115-win32-x64.tar.gz
opencc-v1.1.8-node-v115-darwin-arm64.tar.gz

Puts them locally is pratical, --opencc_binary_host_mirror argument or NPM_CONFIG_opencc_binary_host_mirror environments also supports file:// protocol beside http:// or https://

@DarkNami
Copy link

如果要最新的版本可以去 OpenCC 的 CI 裡找,綠色的是編譯成功的組態,點進去可以在 Artifacts 下載到編譯結果
https://ci.appveyor.com/project/Carbo/OpenCC

@latel
Copy link
Author

latel commented Feb 27, 2025

看过了,产物都是空的呀

Image

@DarkNami
Copy link

我是要使用在 Windows 環境的(.exe),本來也是下載原始碼後嘗試自行在本機編譯,但是結果是失敗的,所以直接到 CI 中剛好找到有編譯好的結果可以下載,於是分享(進行回覆)給您,但依這樣看來您需要的組態似乎並沒有 Artifacts.

Environment: nodejs_version=none; Platform: x64
https://ci.appveyor.com/project/Carbo/OpenCC/build/job/grw99t02sb9is4s0/artifacts

@latel
Copy link
Author

latel commented Mar 3, 2025

看到了,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants