Closed kartik1601 closed 10 months ago
I got the same error as OP. It showed out of the blue as last week I was doing conversions fine.
Edit: Also same Node version and npm as OP. I also tested it on 3 projects I have around and same result.
It's because the package.json file is missing the 'read-pkg-up'
attribute. Please fix that @bjornstar @Enloch @fortinmike @ggozad
same here, is there a way I can manually fix the dependency error or switch to an earlier version? thought it was just because I'm a noob and did something wrong.
Switch to node 16 (16.20.2)
install gltfjsx globally npm install -g gltfjsx
gltfjsx ./model.gltf -t
I have the same issue
@nathaponb I've already tried this, it throws the same error. I've used node v16, v18 and v20, it doesn't work on any. Even after changing some packages.
Have you tried running npm install read-pkg-up
in your node_modules parent directory (srdtu-revamp for you)?
I had the same issue, and I solved it that way.
have you tried running the standalone gltfjsx
cli without npx
?
I mixed @nathaponb + @MatiasMontoto and #201 (comment) to solve. The result is:
"dependencies": { "gltfjsx": "^6.2.11", "read-pkg-up": "^10.0.0", "sharp": "^0.32.5",
I didn't have success using NPM, so I used Yarn and worked :)
my solution that worked for node v18.17.0 :
npm install read-pkg-up
that's it it works perfectly now.
For me I have tried all the above methods nothing worked.
So I cloned the repository locally and run the same command(npx gltfjsx modelname.glb) from the gltfjsx directory and it works. I successfully generated the modelname.jsx file.
I got it to work with npm install read-pkg-up
I mixed @nathaponb + @MatiasMontoto and #201 (comment) to solve. The result is:
"dependencies": { "gltfjsx": "^6.2.11", "read-pkg-up": "^10.0.0", "sharp": "^0.32.5",
I didn't have success using NPM, so I used Yarn and worked :)
Amazing! I have been stuck on this forever and it worked, thank you
I used npm to install those three packages. Also currently on node v19.6.1
npm i gltfjsx read-pkg-up sharp
I used npm to install those three packages. Also currently on node v19.6.1
npm i gltfjsx read-pkg-up sharp
That also did the trick for me using pnpm on node: v18.16.0
Thank you
It did install, but I have this severity warning:
`S Command Injection - https://github.com/advisories/GHSA-926x-m6m5-3mmp No fix available node_modules/push-dir
1 high severity vulnerability
Some issues need review, and may require choosing a different dependency.`
is that fine?
yeap it also worked on me.
npm i gltfjsx read-pkg-up sharp
works pretty fine(react vite environment). But the question is why it works?
This error happens when I try to run the
npx
command to convert the gltf file into jsx. My current node version isv20.5.1
and npm version is9.8.1
. I have also installed gltfjsx package to my node modules.