OpenCC
OpenCC copied to clipboard
Can't Install opencc in my react native project, My react native version is "react-native": "0.63.3"
npm ERR! code 1
npm ERR! path /Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build || node-pre-gyp rebuild
npm ERR! Failed to execute '/usr/local/Cellar/node/17.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! Failed to execute '/usr/local/Cellar/node/17.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | x64
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v102-darwin-x64.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v102-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v102-darwin-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v102 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/BYVoid/OpenCC/releases/download/1.1.3/opencc-v1.1.3-node-v102-darwin-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/local/opt/[email protected]/bin/python3.9"
npm ERR! gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/rakeshthummar/Library/Caches/node-gyp/17.4.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/rakeshthummar/Library/Caches/node-gyp/17.4.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/rakeshthummar/Library/Caches/node-gyp/17.4.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 45, in gyp
failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.1.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/17.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
npm ERR! gyp ERR! cwd /Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc
npm ERR! gyp ERR! node -v v17.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/17.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.gyp
failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.1.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/17.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node" "--module_name=opencc" "--module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v102"
npm ERR! gyp ERR! cwd /Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc
npm ERR! gyp ERR! node -v v17.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/17.4.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --module=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release/opencc.node --module_name=opencc --module_path=/Users/rakeshthummar/Desktop/Upwork Projects//mobile-frontend/src/frameworks/mobile/node_modules/opencc/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v102' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.
npm ERR! A complete log of this run can be found in: npm ERR! /Users/rakeshthummar/.npm/_logs/2022-03-15T09_15_47_684Z-debug-0.log rakeshthummar@Rakeshs-Macbook-Pro mobile % ;
me too
Same here. After installing with --legacy-peer-deps lots of errors show up.
Great library, especially, supports Nodejs. I got it working using below setup:
Ubuntu 20.04 x64 Node v14.17.6, npm v8.1.3, python 3.8 (suggesting sudo apt install python-is-python3) gcc 10