NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.64k stars 4.8k forks source link

Taro 3.6.21在node:18-alpine/20-alpine环境中build中过程报:Error: Cannot find module '@tarojs/binding-linux-x64-musl' #15033

Open smoothdvd opened 11 months ago

smoothdvd commented 11 months ago

相关平台

H5

使用框架: React

复现步骤

Dockerfile:

FROM node:18-alpine ...

docker build .....

期望结果

docker build 成功

实际结果

1.151 > taro build --type h5 1.151 1.814 👽 Taro v3.6.21 1.815 2.202 Error: Cannot find module '@tarojs/binding-linux-x64-musl' 2.202 Require stack: 2.202 - /app/node_modules/.pnpm/@tarojs binding@3.6.21/node_modules/@tarojs/binding/binding.js

环境信息

👽 Taro v3.6.21

  Taro CLI 3.6.21 environment info:
    System:
      OS: macOS 14.2.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.21 => 3.6.21 
      @tarojs/components: 3.6.21 => 3.6.21 
      @tarojs/helper: 3.6.21 => 3.6.21 
      @tarojs/plugin-framework-react: 3.6.21 => 3.6.21 
      @tarojs/plugin-html: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-alipay: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-h5: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-jd: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-qq: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-swan: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-tt: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-weapp: 3.6.21 => 3.6.21 
      @tarojs/plugin-react-devtools: 3.6.21 => 3.6.21 
      @tarojs/react: 3.6.21 => 3.6.21 
      @tarojs/runtime: 3.6.21 => 3.6.21 
      @tarojs/shared: 3.6.21 => 3.6.21 
      @tarojs/taro: 3.6.21 => 3.6.21 
      @tarojs/taro-loader: 3.6.21 => 3.6.21 
      @tarojs/webpack5-runner: 3.6.21 => 3.6.21 
      babel-preset-taro: 3.6.21 => 3.6.21 
      eslint-config-taro: 3.6.21 => 3.6.21 
      react: ^18.0.0 => 18.2.0 
vdfor commented 10 months ago

在 ubuntu 20.04 进行H5构建、taro init 会报

Error: /usr/local/share/.config/yarn/global/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded

luckyadam commented 10 months ago

在 ubuntu 20.04 进行H5构建、taro init 会报

Error: /usr/local/share/.config/yarn/global/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded

目前 taro 的 Rust binding 是在 ubuntu-22.04 上编译的,在 ubuntu 20.04 上可能会有问题

vdfor commented 10 months ago

在 ubuntu 20.04 进行H5构建、taro init 会报 Error: /usr/local/share/.config/yarn/global/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded

目前 taro 的 Rust binding 是在 ubuntu-22.04 上编译的,在 ubuntu 20.04 上可能会有问题

你好,我们发布时是走的ZADIG自动化构建,运行在k8s,构建时也会出现这个问题,请问下这种有没有办法处理呢?或者提供配置可以指定不走 rust 桥接是否可行呢?

luckyadam commented 10 months ago

在 ubuntu 20.04 进行H5构建、taro init 会报 Error: /usr/local/share/.config/yarn/global/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded

目前 taro 的 Rust binding 是在 ubuntu-22.04 上编译的,在 ubuntu 20.04 上可能会有问题

你好,我们发布时是走的ZADIG自动化构建,运行在k8s,构建时也会出现这个问题,请问下这种有没有办法处理呢?或者提供配置可以指定不走 rust 桥接是否可行呢?

我修改下 CI 配置,在 ubuntu 20.04 上进行编译吧

tangbzai commented 10 months ago

我在ci构建时遇到了类似的问题

环境 Taro版本:3.6.22 docker镜像:node:16.20.2

错误信息:

Error: /builds/shifu_admin/shangxue_user/node_modules/.pnpm/@tarojs+binding-linux-x64-gnu@3.6.22/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1282:18)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/builds/shifu_admin/shangxue_user/node_modules/.pnpm/@tarojs+binding@3.6.22/node_modules/@tarojs/binding/binding.js:188:31)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Object.newLoader [as .js] (/builds/shifu_admin/shangxue_user/node_modules/.pnpm/pirates@4.0.6/node_modules/pirates/lib/index.js:121:7)
    at Module.load (node:internal/modules/cjs/loader:1076:32) {
  code: 'ERR_DLOPEN_FAILED'
}
lanzifeng118 commented 9 months ago

升级到3.6.23也会有同样的报错问题

yuuk commented 7 months ago

同遇到,有结论了吗?

HongxuanG commented 7 months ago

CI构建遇到了相同的问题

👽 Taro v3.6.27

27 |   28 | Error: Cannot find module '@tarojs/binding-linux-x64-musl' 29 | Require stack: 30 | - /drone/src/node_modules/@tarojs/binding/binding.js 31 | - /drone/src/node_modules/@tarojs/cli/dist/create/project.js 32 | - /drone/src/node_modules/@tarojs/cli/dist/index.js 33 | - /drone/src/node_modules/@tarojs/cli/index.js 34 | - /drone/src/config/index.ts 35 | - /drone/src/node_modules/@tarojs/service/dist/Config.js 36 | - /drone/src/node_modules/@tarojs/service/dist/index.js 37 | - /drone/src/node_modules/@tarojs/service/index.js 38 | - /drone/src/node_modules/@tarojs/cli/dist/cli.js 39 | - /drone/src/node_modules/@tarojs/cli/bin/taro 40 | at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) 41 | at Function.Module._load (node:internal/modules/cjs/loader:922:27) 42 | at Module.require (node:internal/modules/cjs/loader:1143:19) 43 | at require (node:internal/modules/cjs/helpers:110:18) 44 | at Object. (/drone/src/node_modules/@tarojs/binding/binding.js:175:31) 45 | at Module._compile (node:internal/modules/cjs/loader:1256:14) 46 | at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) 47 | at Object.newLoader [as .js] (/drone/src/node_modules/pirates/lib/index.js:121:7) 48 | at Module.load (node:internal/modules/cjs/loader:1119:32) 49 | at Function.Module._load (node:internal/modules/cjs/loader:960:12) { 50 | code: 'MODULE_NOT_FOUND', 51 | requireStack: [ 52 | '/drone/src/node_modules/@tarojs/binding/binding.js', 53 | '/drone/src/node_modules/@tarojs/cli/dist/create/project.js', 54 | '/drone/src/node_modules/@tarojs/cli/dist/index.js', 55 | '/drone/src/node_modules/@tarojs/cli/index.js', 56 | '/drone/src/config/index.ts', 57 | '/drone/src/node_modules/@tarojs/service/dist/Config.js', 58 | '/drone/src/node_modules/@tarojs/service/dist/index.js', 59 | '/drone/src/node_modules/@tarojs/service/index.js', 60 | '/drone/src/node_modules/@tarojs/cli/dist/cli.js', 61 | '/drone/src/node_modules/@tarojs/cli/bin/taro' 62 | ] 63 | } 64 | 找不到项目配置文件config/index,请确定当前目录是 Taro 项目根目录! 65 | error Command failed with exit code 1. 66 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

HongxuanG commented 6 months ago

在 ubuntu 20.04 进行H5构建、taro init 会报 Error: /usr/local/share/.config/yarn/global/node_modules/@tarojs/binding-linux-x64-gnu/taro.linux-x64-gnu.node: undefined symbol: __libc_single_threaded

目前 taro 的 Rust binding 是在 ubuntu-22.04 上编译的,在 ubuntu 20.04 上可能会有问题

你好,我们发布时是走的ZADIG自动化构建,运行在k8s,构建时也会出现这个问题,请问下这种有没有办法处理呢?或者提供配置可以指定不走 rust 桥接是否可行呢?

我修改下 CI 配置,在 ubuntu 20.04 上进行编译吧

具体哪个版本会弄这个,我现在只敢停留在3.6.17版本因为这个版本才能使用CI推送,CI服务器是ubuntu 20.04的

WangShayne commented 3 months ago

使用Ubuntu22.04 运行npx @tarojs/cli-convertor 报错

npx @tarojs/cli-convertor                                                                               18.20.4  03:58:57
~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/binding/binding.js:248
    throw loadError
    ^

Error: Cannot find module '@tarojs/binding-linux-x64-gnu'
Require stack:
- ~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/binding/binding.js
- ~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/cli-convertor/dist/index.js
- ~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/cli-convertor/bin/taro-convert
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/binding/binding.js:188:31)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/binding/binding.js',
    '~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/cli-convertor/dist/index.js',
    '~/.npm/_npx/1c50f9067efbafcb/node_modules/@tarojs/cli-convertor/bin/taro-convert'
  ]
}

Node.js v18.20.4
taro                                                                                 
👽 Taro v3.6.24
keyboard2005 commented 3 months ago

+1 系统信息是 └─$ cat /etc/os-release PRETTY_NAME="Kali GNU/Linux Rolling" NAME="Kali GNU/Linux" VERSION_ID="2024.2" VERSION="2024.2" VERSION_CODENAME=kali-rolling ID=kali ID_LIKE=debian HOME_URL="https://www.kali.org/" SUPPORT_URL="https://forums.kali.org/" BUG_REPORT_URL="https://bugs.kali.org/" ANSI_COLOR="1;31"

└─$ taro init myApp 
👽 Taro v4.0.4

node:internal/modules/cjs/loader:1028
  const err = new Error(message);
              ^

Error: Cannot find module '@tarojs/binding-linux-x64-gnu'
Require stack:
- /home/keyboard/.nvm/versions/node/v16.20.2/lib/node_modules/@tarojs/cli/node_modules/@tarojs/binding/binding.js
- /home/keyboard/.nvm/versions/node/v16.20.2/lib/node_modules/@tarojs/cli/dist/create/project.js
- /home/keyboard/.nvm/versions/node/v16.