gltf-transform cli cannot start with node16. Is there a certain node version which I have to use?
See original GitHub issueHi!
After running this command: npm install --global @gltf-transform/cli I would like to start the gltf-transform cli, but then this error appears:
ode:internal/modules/cjs/loader:1126
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/jota/.nvm/versions/node/v16.3.0/lib/node_modules/@gltf-transform/cli/node_modules/gl-matrix/dist/esm/vec3.js
require() of ES modules is not supported.
require() of /home/jota/.nvm/versions/node/v16.3.0/lib/node_modules/@gltf-transform/cli/node_modules/gl-matrix/dist/esm/vec3.js from /home/jota/.nvm/versions/node/v16.3.0/lib/node_modules/@gltf-transform/cli/node_modules/@gltf-transform/core/dist/core.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename vec3.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/jota/.nvm/versions/node/v16.3.0/lib/node_modules/@gltf-transform/cli/node_modules/gl-matrix/package.json.
To Reproduce
- Install node16
- Install gltf-transform cli with npm install --global @gltf-transform/cli
- Try to run gltf-transform
- See error
Expected behavior No error…
Versions:
- Version: 0.12.15
- Environment: Ubuntu 18.04
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
@gltf-transform/cli - npm
Start using @gltf-transform/cli in your project by running `npm i @gltf-transform/cli`. There is 1 other project in the npm registry using ...
Read more >Use GLTF-transform merge command - node js script
I want to use the gltf-transform command ...
Read more >Can I change the version of node.js my project uses?
Yes, you can do so by updating the engines field specified in the package.json project file. Currently, Glitch supports node.js versions 6.17.1 through ......
Read more >CLI | glTF-Transform - Don McCurdy
Documentation for CLI in glTF-Transform, a glTF 2.0 SDK for JavaScript, TypeScript, and Node.js.
Read more >Home | xeokit-convert
As such, some IFC models may not convert properly. ... Let's use the convert2xkt Node script to convert an IFC file to XKT...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just published v0.12.16, pinned to gl-matrix@~3.3.0. Hopefully that fixes the regression, but let me know if not!
Have also added integration test coverage for Node.js v16, which seems to be working fine.
The integration tests check Node.js v12 and v14 so probably those are the safest options. I’ll try adding v16 to the tests and see what happens – was v16 working before the gl-matrix dependency update for anyone?
It looks like gl-matrix has already gotten reports about this (https://github.com/toji/gl-matrix/issues/439) and are planning to revert 3.4.0 shortly. I’ll see about switching this project’s production dependencies to
~
instead of^
as well.