[Question]如何解决`Cannot find target @builder/swc native module!`
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 611
- PR merge metrics
- No merged PRs in 30d
Description
背景
```
9320 verbose Linux 3.10.0-693.el7.x86_64
9321 verbose argv "/usr/bin/node" "/usr/bin/npm" "i"
9322 verbose node v16.14.1
9323 verbose npm v8.5.0
npm run build
[root@VM-0-14-centos test]# npm run build
> @rax-materials/scaffolds-app-ts@0.1.0 build
> rax-app build
rax-app 3.8.18
JSX+ enabled, documentation: https://rax.js.org/docs/guide/component
✖ Web
Compiled with some errors in 7.11s
info WEBPACK web:
info WEBPACK assets by status 71.6 KiB [cached] 2 assets
info WEBPACK web (webpack 5.67.0) compiled with 1 error in 7116 ms
ERR! Error: Cannot find target @builder/swc native module!
ERR! webpack compile error
Error: webpack compile error
at /var/lib/jenkins/workspace/test/node_modules/build-scripts/lib/service/build.js:81:28
at /var/lib/jenkins/workspace/test/node_modules/@builder/pack/deps/webpack/bundle5.js:73772:14
at processQueueWorker (/var/lib/jenkins/workspace/test/node_modules/@builder/pack/deps/webpack/bundle5.js:73709:6)
at processTicksAndRejections (node:internal/process/task_queues:78:11)
``
Contributor guide
Research direction
Reproduce the failure with npm i followed by npm run build using the reported Node 16.14.1 environment. Start with the stack trace at node_modules/build-scripts/lib/service/build.js:81 and the @builder/pack webpack bundle, then determine why @builder/swc cannot load its native module. Done means the reported build completes without the native-module error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100