yanyiwu / nodejieba

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

Install succeed, but can not run. #156

Open johnsmith0209 opened 4 years ago

johnsmith0209 commented 4 years ago

安装时成功的,发现node-pre-gyp会在找不到对应binding的时候进行本地build。 但无法启动。

报错内容:

0|api  | Error: The module 'xxx/node_modules/_nodejieba@2.4.0@nodejieba/build/Release/nodejieba.node'
0|api  | was compiled against a different Node.js version using
0|api  | NODE_MODULE_VERSION 72. This version of Node.js requires
0|api  | NODE_MODULE_VERSION 64. Please try re-compiling or re-installing

build/config.gypi文件内容:

# Do not edit. File was generated by node-gyp's "configure" step
{
  "target_defaults": {
    "cflags": [],
    "default_configuration": "Release",
    "defines": [],
    "include_dirs": [],
    "libraries": []
  },
  "variables": {
    "asan": 0,
    "build_v8_with_gn": "false",
    "coverage": "false",
    "debug_nghttp2": "false",
    "debug_node": "false",
    "enable_lto": "false",
    "enable_pgo_generate": "false",
    "enable_pgo_use": "false",
    "force_dynamic_crt": 0,
    "host_arch": "x64",
    "icu_data_in": "../../deps/icu-small/source/data/in/icudt65l.dat",
    "icu_default_data": "",
    "icu_endianness": "l",
    "icu_gyp_path": "tools/icu/icu-generic.gyp",
    "icu_locales": "en,root",
    "icu_path": "deps/icu-small",
    "icu_small": "true",
    "icu_ver_major": "65",
    "is_debug": 0,
    "llvm_version": "0.0",
    "napi_build_version": "0",
    "node_byteorder": "little",
    "node_debug_lib": "false",
    "node_enable_d8": "false",
    "node_install_npm": "true",
    "node_module_version": 72,
    "node_no_browser_globals": "false",
    "node_prefix": "/",
    "node_release_urlbase": "https://nodejs.org/download/release/",
    "node_report": "true",
    "node_shared": "false",
    "node_shared_brotli": "false",
    "node_shared_cares": "false",
    "node_shared_http_parser": "false",
    "node_shared_libuv": "false",
    "node_shared_nghttp2": "false",
    "node_shared_openssl": "false",
    "node_shared_zlib": "false",
    "node_tag": "",
    "node_target_type": "executable",
    "node_use_bundled_v8": "true",
    "node_use_dtrace": "true",
    "node_use_etw": "false",
    "node_use_large_pages": "false",
    "node_use_large_pages_script_lld": "false",
    "node_use_node_code_cache": "true",
    "node_use_node_snapshot": "true",
    "node_use_openssl": "true",
    "node_use_v8_platform": "true",
    "node_with_ltcg": "false",
    "node_without_node_options": "false",
    "openssl_fips": "",
    "openssl_is_fips": "false",
    "shlib_suffix": "72.dylib",
    "target_arch": "x64",
    "v8_enable_gdbjit": 0,
    "v8_enable_i18n_support": 1,
    "v8_enable_inspector": 1,
    "v8_no_strict_aliasing": 1,
    "v8_optimized_debug": 1,
    "v8_promise_internal_field_count": 1,
    "v8_random_seed": 0,
    "v8_trace_maps": 0,
    "v8_use_siphash": 1,
    "v8_use_snapshot": 1,
    "want_separate_host_toolset": 0,
    "xcode_version": "11.0",
    "nodedir": "/Users/xxx/Library/Caches/node-gyp/12.16.2",
    "standalone_static_library": 1,
    "fallback_to_build": "true",
    "module": "xxxx/_nodejieba@2.4.0@nodejieba/build/Release/nodejieba.node",
    "module_name": "nodejieba",
    "module_path": "xxxx/node_modules/_nodejieba@2.4.0@nodejieba/build/Release",
    "napi_version": "5",
    "node_abi_napi": "napi",
    "node_napi_label": "node-v72",
    "registry": "https://r.npm.taobao.org",
    "userconfig": "/Users/tony/.cnpmrc",
    "r": "https://r.npm.taobao.org",
    "disturl": "https://npm.taobao.org/mirrors/node",
    "cache": "/Users/xxx/.npminstall_tarball",
    "user_agent": "npminstall/3.27.0 npm/? node/v12.16.2 darwin x64",
    "sharp_binary_host": "https://cdn.npm.taobao.org/dist/sharp"
  }
}
Brooooooklyn commented 4 years ago

试一下 @node-rs/jieba

github-actions[bot] commented 3 days ago

This issue has not been updated for over 3 years and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.