web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
8.15k stars 484 forks source link

Error: Cannot find module '/rspack/crates/node_binding/node_modules/@rspack/binding-darwin-arm64/rspack.darwin-arm64.node' in example folder #4774

Closed xiaojingzhao closed 7 months ago

xiaojingzhao commented 7 months ago

System Info

System: OS: macOS 13.6 CPU: (12) arm64 Apple M2 Pro Memory: 134.28 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm Browsers: Chrome: 119.0.6045.159 Safari: 17.0 npmPackages: @rspack/cli: workspace:^ => 0.4.0

Details

I've just clone this repo to local and run pnpm install and try to run examples in this repo: examples/basic.

cd examples/basic
pnpm run dev

And I got this error:

image

Even though I installed this dependency manually in rspack/crates/node_binding, I still got this error as there is no @rspack/binding-darwin-arm64/rspack.darwin-arm64.node in node_modules?

image

Reproduce link

No response

Reproduce Steps

  1. git clone https://github.com/web-infra-dev/rspack.git
  2. cd rspack
  3. pnpm i
  4. cd examples/basic
  5. pnpm run dev
jerrykingxyz commented 7 months ago

The example/basic will use rspack from the workspace, so you should build rspack first. Here is the doc about building rspack: https://web-infra-dev.github.io/rspack-dev-guide/building/intro.html

xiaojingzhao commented 7 months ago

The example/basic will use rspack from the workspace, so you should build rspack first. Here is the doc about building rspack: https://web-infra-dev.github.io/rspack-dev-guide/building/intro.html

Works for me. Thanks a lot!!