Hi!
Every time I try to export a scene (even default one) on local npm installation I get this error in viewport despite having already run npm instal in the first place:
Dependencies needed for export
It looks like this project is a new one since its dependencies are not yet installed. This is necessary to export your scene.
In order to install the dependencies, run either
npm install or yarn
from your project directory.
here are the specs of my installation
react three fiber // javascript variant
and these are the warns I get after running npm install:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: web-ifc-three@0.0.125
npm WARN Found: three@0.152.2
npm WARN node_modules/@polygonjs/polygonjs/node_modules/three
npm WARN three@“0.152.2” from @polygonjs/polygonjs@1.4.22
npm WARN node_modules/@polygonjs/polygonjs
npm WARN @polygonjs/polygonjs@“^1.4.2” from @polygonjs/react-three-fiber@1.4.2
npm WARN node_modules/@polygonjs/react-three-fiber
npm WARN 2 more (three-mesh-bvh, three-mesh-bvh)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer three@“^0.149.0” from web-ifc-three@0.0.125
npm WARN node_modules/@polygonjs/polygonjs/node_modules/web-ifc-three
npm WARN web-ifc-three@“0.0.125” from @polygonjs/polygonjs@1.4.22
npm WARN node_modules/@polygonjs/polygonjs
npm WARN
npm WARN Conflicting peer dependency: three@0.149.0
npm WARN node_modules/three
npm WARN peer three@“^0.149.0” from web-ifc-three@0.0.125
npm WARN node_modules/@polygonjs/polygonjs/node_modules/web-ifc-three
npm WARN web-ifc-three@“0.0.125” from @polygonjs/polygonjs@1.4.22
npm WARN node_modules/@polygonjs/polygonjs
I get also a ’threejs is not installed’ error when I try to install dependencies fromwindow>libraries
It looks like I‘m missing some very basic stuff here…
anyone could help clarifying?
Thanks a lot for this clear report, and it looks like you found a nasty bug.
I’ve just tested, and while the install works fine when using yarn, it does not when using npm. It seems that the reason is that the node_modules folder is populated differently, and polygonjs then fails to find the right version of threejs to get the draco and other libs from.
I’ll investigate and fix this, putting this in high priority, and will report back here.
But in the mean time, the only current work around I can suggest is to use yarn (and you could always switch back to npm later on if needed).
I’ve just deployed a new version, 1.4.23, which should fix the problem.
Now, if the any of the sub modules depends on a different three version, and therefore leads to multiple threejs being installed deep inside the node_modules tree, polygonjs will be able to find the correct one and install the libraries like draco from there.
But unfortunately, there seems to be an additional problem that just appeared, which is that npm install just hands and never completes ( when yarn still completes the installation just fine ). I don’t yet have an explanation for that. But I’ve had several other issues with npm over the years, so for now, I’ll just remove it from the doc. So for now, I still recommend to use yarn instead of npm.
I’ve looked again in this issue, and the hanging when running npm install seems to have been caused by dependency versions that could not be handled by npm. I’m still unsure of the exact reason behind this, as installing with yarn had no such problem, but I’ve just released 1.4.24 where the issue seems fixed.
I’ve written a more detailed explanation in the changelog if you’re curious.
Hi Gui,
Thank you for the detailed explanation and all the attempts to fix the issue.
I momentarily switched to the online version as I’m still in an experimentation process.
Anyway I can confirm you that the yarn installation works smoothly
To give you a feedback I just tried an npm install with new release and it gives me same issue during installation.
No big deal as yarn is doing the job nicely
During installation I get this warnings and actually the same problem with export:
install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: web-ifc-three@0.0.125
npm WARN Found: three@0.152.2
npm WARN node_modules/@polygonjs/polygonjs/node_modules/three
npm WARN node_modules/@polygonjs/polygonjs
npm WARN @polygonjs/polygonjs@“^1.4.23” from @polygonjs/react-three-fiber@1.4.23
npm WARN node_modules/@polygonjs/react-three-fiber
npm WARN 1 more (polygonjs-editor)
npm WARN 1 more (three-mesh-bvh)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer three@“^0.149.0” from web-ifc-three@0.0.125
npm WARN node_modules/@polygonjs/polygonjs/node_modules/web-ifc-three
npm WARN web-ifc-three@“0.0.125” from @polygonjs/polygonjs@1.4.24
npm WARN node_modules/@polygonjs/polygonjs
npm WARN
npm WARN Conflicting peer dependency: three@0.149.0
npm WARN node_modules/three
npm WARN peer three@“^0.149.0” from web-ifc-three@0.0.125
npm WARN node_modules/@polygonjs/polygonjs/node_modules/web-ifc-three
npm WARN web-ifc-three@“0.0.125” from @polygonjs/polygonjs@1.4.24
npm WARN node_modules/@polygonjs/polygonjs
added 443 packages, and audited 444 packages in 1m
43 packages are looking for funding
run npm fund for details
4 moderate severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run npm audit for details.
export
Dependencies needed for export
It looks like this project is a new one since its dependencies are not yet installed. This is necessary to export your scene.
In order to install the dependencies, run either npm installoryarn from your project directory.
Thanks a lot for the feedback, and great to read that yarn works fine for you.
And thank you for letting me know you still hit issues with npm install, definitely good to know. I’ve actually just tried again here, with 1.4.25 that I’ve just released, and both the install process and the library installation work fine on my end.
There could still be a number of reason this could happen on a different system. So in case you ever decide to try again with npm, or if someone else reads this and faces the same issue, you could try the following:
delete the node_module and package-lock.json, and the re-install with npm i.
check the version of node ( with node --version ), I currently use v16.15.1
check the version of npm ( with npm --verison ), I currently use 9.7.2, which I believe is the most recent
check the version of polygonjs-editor ( in the package.json file ), which should be 1.4.24-2 or 1.4.25-1, or higher.
if nothing works, I’d be curious to see the content of the log file .polygonjs-editor.log from inside the project.
In any case, if yarn work for you, my recommendation is definitely to stick to it. That’s what I use every day.
Thanks a lot for this log.
And I can indeed see that Polygonjs tries to compile the export and fails, but there doesn’t seem to be an obvious reason.
Then I was wondering if it was due to being on windows (I’m always on linux or mac, very rarely on windows), but since it works with yarn, it unlikely to be OS related.
I don’t want to waste too much of your time on this one, but if you could send me a zip of your project, I could then test it here and be sure I have the same exact files. If you have polygon open, you can do it quickly from the top menu → Windows → Share Scene → Create Zip Archive Of Full Project. It will create a zip without the node_modules folder, and the zip should be small enough to be shared by email.