step 1 npm i three-gpu-pathtracer
step 2 vite (or other run)
step 3 can not found three-mesh-bvh
npm i three-mesh-bvh
?
yes, i mean,
why “npm i three-gpu-pathtracer” does not install three-mesh-bvh ?
The library extends the core package three-mesh-bvh (both developed by the same creator). It declares three-mesh-bvh as a peerDependency to prevent duplicate installations. three
is also declared as a peerDependency, as the library is built around it and expects it to be installed.
This approach keeps the library lightweight, avoids redundancy, and reduces the likelihood of version conflicts, while giving you more or less flexibility over which versions of three
and three-mesh-bvh
to use.
Thank you very much, I don’t have a detailed understanding of packagejson. Previously, I only knew
Dependencies and devDependencies. From your explanation, peerDependencies is a better design (I thought it was an oversight before)