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

在执行npm run build:rn时报错 unknown field cwd at module.exports.__wbindgen_error_new #14137

Closed
enjoylee-lionjoy opened this issue Jul 8, 2023 · 6 comments
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@enjoylee-lionjoy
Copy link

相关平台

React Native

使用框架: React

复现步骤

? 请输入项目名称! bajiaoren
? 请输入项目介绍
? 请选择框架 React
? 是否需要使用 TypeScript ? No
? 请选择 CSS 预处理器(Sass/Less/Stylus) 无
? 请选择编译工具 Webpack4
? 请选择包管理工具 yarn
? 请选择模板源 Gitee(最快)
✔ 拉取远程模板仓库成功!
? 请选择模板 react-native
...
✔ 创建文件: E:\baJoinApp\bajiaoren\android\app\src\main\java\com\tarodemo\newarchitecture\modules\MainApplicationTurboModuleManagerDelegate.java
✔ 项目名更新成功!
✔ cd bajiaoren, 执行 git init
yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
⚠ warning @tarojs/rn-supporter > metro > metro-minify-uglify > [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
⚠ warning @tarojs/rn-supporter > react-native-svg-transformer > @svgr/plugin-svgo > [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
⚠ warning @tarojs/rn-supporter > react-native-svg-transformer > @svgr/plugin-svgo > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
⚠ warning @tarojs/rn-supporter > @tarojs/rn-style-transformer > stylus > css > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
⚠ warning @tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > babel-runtime > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
⚠ warning @tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
⚠ warning @tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
⚠ warning @tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
⚠ warning @tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
⚠ warning @tarojs/taro-rn > expo-file-system > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
⚠ warning @tarojs/cli > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
⚠ warning @tarojs/cli > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
⚠ warning @tarojs/cli > request > [email protected]: this library is no longer supported
⚠ warning @tarojs/rn-runner > @rollup/plugin-replace > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
⚠ warning @tarojs/mini-runner > copy-webpack-plugin > webpack-log > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
⚠ warning @tarojs/mini-runner > terser-webpack-plugin > cacache > @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
⚠ warning @tarojs/mini-runner > @tarojs/runner-utils > scss-bundle > @types/[email protected]: This is a stub types definition. sass provides its own type definitions, so you do not need this installed.
⚠ warning @tarojs/mini-runner > webpack > watchpack > watchpack-chokidar2 > [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
⚠ warning @tarojs/mini-runner > webpack > watchpack > watchpack-chokidar2 > chokidar > [email protected]: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
⚠ warning @tarojs/webpack-runner > webpack-dev-server > [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
⚠ warning @tarojs/webpack-runner > resolve-url-loader > rework > css > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning @tarojs/webpack-runner > resolve-url-loader > rework > css > [email protected]: Please see https://github.com/lydell/urix#deprecated
⚠ warning install-peerdeps > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
⚠ warning install-peerdeps > @babel/polyfill > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
⚠ warning stylelint > file-entry-cache > flat-cache > [email protected]: CircularJSON is in maintenance only, flatted is its successor.
⚠ warning stylelint > postcss-markdown > remark > remark-parse > [email protected]: Use String.prototype.trim() instead
[2/4] Fetching packages...
[3/4] Linking dependencies...
⚠ warning "@tarojs/rn-supporter > [email protected]" has unmet peer dependency "react-native-svg@>=6.5.1".
⚠ warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "@react-native-masked-view/masked-view@~0.2.7".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-gesture-handler@~2.9.0".
⚠ warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-safe-area-context@~4.4.1".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-screens@^3.18.2".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "@react-native-community/slider@~4.3.2".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "@react-native-picker/picker@~2.4.2".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "expo@~47.0.3".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "expo-av@~13.0.0".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "expo-barcode-scanner@~12.0.0".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "expo-camera@~13.0.0".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-pager-view@~6.0.1".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-svg@~13.7.0".
warning "@tarojs/runtime-rn > @tarojs/[email protected]" has unmet peer dependency "react-native-webview@~11.23.0".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
⚠ warning "@tarojs/runtime-rn > @tarojs/components-rn > @ant-design/[email protected]" has unmet peer dependency "@react-native-camera-roll/camera-roll@>= 5.0.0".
warning "@tarojs/runtime-rn > @tarojs/components-rn > @ant-design/[email protected]" has unmet peer dependency "@react-native-community/segmented-control@>= 1.4.0".
warning "@tarojs/runtime-rn > @tarojs/components-rn > @ant-design/[email protected]" has unmet peer dependency "react-native-gesture-handler@^2.2.1".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > expo-image-picker > [email protected]" has unmet peer dependency "expo@*".
⚠ warning "@tarojs/runtime-rn > @tarojs/components-rn > @ant-design/react-native > react-native-codegen > [email protected]" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "@tarojs/runtime-rn > @tarojs/components-rn > expo-camera > @koale/[email protected]" has incorrect peer dependency "react@^16.8.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "@bam.tech/react-native-image-resizer@~3.0.4".
warning " > @tarojs/[email protected]" has unmet peer dependency "@react-native-async-storage/async-storage@~1.17.7".
warning " > @tarojs/[email protected]" has unmet peer dependency "@react-native-camera-roll/camera-roll@~5.0.4".
⚠ warning " > @tarojs/[email protected]" has unmet peer dependency "@react-native-clipboard/clipboard@~1.11.1".
warning " > @tarojs/[email protected]" has unmet peer dependency "@react-native-community/geolocation@~3.0.2".
warning " > @tarojs/[email protected]" has unmet peer dependency "@react-native-community/netinfo@~9.3.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-av@~13.0.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-barcode-scanner@~12.0.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-brightness@~11.0.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-camera@~13.0.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-file-system@~15.1.1".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-image-picker@~14.0.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-keep-awake@~11.0.1".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-location@~15.0.1".
warning " > @tarojs/[email protected]" has unmet peer dependency "expo-sensors@~12.0.1".
warning " > @tarojs/[email protected]" has unmet peer dependency "react-native-device-info@~10.3.0".
warning " > @tarojs/[email protected]" has unmet peer dependency "react-native-safe-area-context@~4.4.1".
⚠ warning " > @tarojs/[email protected]" has unmet peer dependency "[email protected]".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
⚠ warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
warning "@tarojs/taro-rn > [email protected]" has unmet peer dependency "expo@*".
⚠ warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning "react-native > react-native-codegen > [email protected]" has unmet peer dependency "@babel/preset-env@^7.1.6".
⚠ warning "@tarojs/rn-runner > [email protected]" has unmet peer dependency "acorn@^6.0.0 || ^7.0.0 || ^8.0.0".
⚠ warning "@tarojs/rn-runner > @rollup/[email protected]" has unmet peer dependency "rollup@^1.20.0 || ^2.0.0".
warning "@tarojs/rn-runner > @rollup/[email protected]" has unmet peer dependency "rollup@^1.20.0 || ^2.0.0".
warning "@tarojs/rn-runner > @rollup/[email protected]" has unmet peer dependency "rollup@^2.42.0".
warning "@tarojs/rn-runner > @rollup/[email protected]" has unmet peer dependency "rollup@^2.38.3".
warning "@tarojs/rn-runner > @rollup/[email protected]" has unmet peer dependency "rollup@^1.20.0||^2.0.0".
⚠ warning "@tarojs/rn-runner > @rollup/plugin-json > @rollup/[email protected]" has unmet peer dependency "rollup@^1.20.0||^2.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 91.27s.
✔ 安装成功
创建项目 bajiaoren 成功!
请进入项目目录 bajiaoren 开始工作吧!😝

$ yarn upgradePeerdeps
yarn run v1.22.19
SUCCESS The peerDeps of @tarojs/taro-rn were installed successfully.
SUCCESS The peerDeps of @tarojs/components-rn were installed successfully.
SUCCESS The peerDeps of @tarojs/router-rn were installed successfully.
Scanning for pods...
CocoaPods is only supported on darwin machines
Done in 40.45s.

$ npm run build:rn

期望结果

执行成功

实际结果

[email protected] build:rn
taro build --type rn

👽 Taro v3.6.6

Error: Bindings not found
at Compiler.transformSync (E:\baJoinApp\bajiaoren\node_modules@swc\core\index.js:250:15)
at Object.transformSync (E:\baJoinApp\bajiaoren\node_modules@swc\core\index.js:348:21)
at compile (E:\baJoinApp\bajiaoren\node_modules@swc\register\lib\node.js:76:22)
at compileHook (E:\baJoinApp\bajiaoren\node_modules@swc\register\lib\node.js:91:16)
at Module._compile (E:\baJoinApp\bajiaoren\node_modules\pirates\lib\index.js:113:29)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Object.newLoader [as .js] (E:\baJoinApp\bajiaoren\node_modules\pirates\lib\index.js:121:7)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
Error: Bindings not found
at Compiler.transformSync (E:\baJoinApp\bajiaoren\node_modules@swc\core\index.js:250:15)
at Object.transformSync (E:\baJoinApp\bajiaoren\node_modules@swc\core\index.js:348:21)
at compile (E:\baJoinApp\bajiaoren\node_modules@swc\register\lib\node.js:76:22)
at compileHook (E:\baJoinApp\bajiaoren\node_modules@swc\register\lib\node.js:91:16)
at Module._compile (E:\baJoinApp\bajiaoren\node_modules\pirates\lib\index.js:113:29)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Object.newLoader [as .js] (E:\baJoinApp\bajiaoren\node_modules\pirates\lib\index.js:121:7)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\utils\index.js:89
throw new Error(插件依赖 "${item}" 加载失败,请检查插件配置);
^

Error: 插件依赖 "E:\baJoinApp\bajiaoren\node_modules@tarojs\cli\dist\presets\index.js" 加载失败,请检查插件配置
at apply (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\utils\index.js:89:31)
at Kernel.initPreset (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:117:38)
at Kernel.resolvePresets (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:92:18)
at Kernel.initPresetsAndPlugins (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:86:14)
at Kernel. (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:306:18)
at Generator.next ()
at E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:8:71
at new Promise ()
at __awaiter (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:4:12)
at Kernel.run (E:\baJoinApp\bajiaoren\node_modules@tarojs\service\dist\Kernel.js:290:16)

Node.js v18.16.0

环境信息

👽 Taro v3.6.6


  Taro CLI 3.6.6 environment info:
    System:
      OS: Windows 10 10.0.22000
    Binaries:
      Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.6 => 3.6.6
      @tarojs/components: 3.6.6 => 3.6.6
      @tarojs/helper: 3.6.6 => 3.6.6
      @tarojs/mini-runner: 3.6.6 => 3.6.6
      @tarojs/plugin-framework-react: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-alipay: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-h5: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-jd: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-qq: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-swan: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-tt: 3.6.6 => 3.6.6
      @tarojs/plugin-platform-weapp: 3.6.6 => 3.6.6
      @tarojs/react: 3.6.6 => 3.6.6
      @tarojs/rn-runner: 3.6.6 => 3.6.6
      @tarojs/rn-supporter: 3.6.6 => 3.6.6
      @tarojs/runtime: 3.6.6 => 3.6.6
      @tarojs/runtime-rn: 3.6.6 => 3.6.6
      @tarojs/shared: 3.6.6 => 3.6.6
      @tarojs/taro: 3.6.6 => 3.6.6
      @tarojs/taro-rn: 3.6.6 => 3.6.6
      @tarojs/webpack-runner: 3.6.6 => 3.6.6
      babel-preset-taro: 3.6.6 => 3.6.6
      eslint-config-taro: 3.6.6 => 3.6.6
      expo: ~47.0.3 => 47.0.14
      react: ^18.1.0 => 18.2.0
      react-native: ^0.70.1 => 0.70.12
@taro-bot2 taro-bot2 bot added F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x labels Jul 8, 2023
@enjoylee-lionjoy
Copy link
Author

按照百度到的某个教程 安装了c++依赖重启电脑后,依旧存在这个问题。删除node_modules文件夹后 重新安装依赖依旧存在。代码并未做任何更改,严格按照官方文档要求一步一步操作。

@zhiqingchen
Copy link
Member

https://github.com/zhiqingchen/taro-test

参考,正常通过编译的分支

@aresuper
Copy link

aresuper commented Aug 3, 2023

按照百度到的某个教程 安装了c++依赖重启电脑后,依旧存在这个问题。删除node_modules文件夹后 重新安装依赖依旧存在。代码并未做任何更改,严格按照官方文档要求一步一步操作。

解决了吗?我也遇到类似的问题 不过我只是正常Taro小程序项目

@shaohao123
Copy link

加一 求解决了么

@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 2, 2023

的确有收到不少同学反馈,swc 插件在 Windows 下需要安装 C++ 环境:#12676

各位可以安装 C++ 环境后,删除 node_modules 和 lockfile 后再试试的

@Chen-jj Chen-jj closed this as completed Sep 2, 2023
@jqroom
Copy link

jqroom commented Oct 27, 2023

@enjoylee-lionjoy 我今天遇到了一样的问题,node 从14 升级到16、18后,去掉了所有的lockfile,也重新安装了npm包,问题还是存在,后面在这里找到了答案:https://github.com/swc-project/swc/issues/5616#issuecomment-1715561365。
@swc/core使用1.3.84版本

"@swc/core": "1.3.84"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

6 participants